Wednesday, December 10, 2014

Wednesday, December 10th

Today was a half regular class, half Hour of Code class.

I got into class and got straight to CodingBat. I even finished Logic 1 today, minus the string problems which Mr. Daly said he would teach me on Friday.

Today's problem :

Given two ints, each in the range 10..99, return true if there is a digit that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e.g. n/10, gives the left digit while the % "mod" n%10 gives the right digit.) 




So after the first half of the class, I went to the fourth grade to help out with the Hour of Code with Martynas. Once again, I was impressed that these kids completed the problems with such ease because I know that at their age it would've been impossible to do it so easily. I met this one brilliant person ( I forget his name) who solved 3 problems before I even had time to think of the solution myself. I like the Hour of Code very much and I think it was a good idea that we implemented it in the school.





























Monday, December 8, 2014

Monday, December 8th

Today was not a regular class.
Today, I participated in the Hour of Code with elementary schoolers. It was actually a very interesting experience.  I went to the elementary school and library during G block and so I didn't come to E block.

I went to room 116 at first, and it was a third grade classroom. I came in and there were about 20 kids, all working on the hour of code. I remembered then that I had actually completed the hour of code myself some years ago, so I knew what it was ! I knew how it worked and what we were supposed to do.
There was this one little girl that needed some help, so I stayed with her most of the time. She was a bit confused at first - but she knew what she was supposed to do. She just wasn't sure if she was doing it correctly. And so we worked on a few problems together. The scenario was a sort of angry birds remake where the bird had to move to the pig to kill it. There were paths, and the option controls were these:

move forward

turn right (rotation)

turn left (rotation).



 Later on, the programs got a bit harder and looked more like this:


I helped the girl out and after a few scenarios she was getting the hang of it. Later on she got a bit more confused when the program introduced her to "loops". She needed help with that so I gave her a hand.

Later during the day I went to the library to do the exact same thing with a group of kids about the same age. At one point, when I was working with this one child called Adi, he figured out a problem before I did !

I felt like it was a good experience to help these kids learn and even watch them figure out the problems by themselves. I would definitely want to take part in it again this week, if possible.

Thursday, December 4, 2014

Tuesday, December 4th

Regular class, like always. I got even closer to finishing Logic 1 - now I have only a few problems left to finish.
Today I worked on CodingBat.

This is today's problem of the day:

You have a blue lottery ticket, with ints a, b, and c on it. This makes three pairs, which we'll call ab, bc, and ac. Consider the sum of the numbers in each pair. If any pair sums to exactly 10, the result is 10. Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the result is 5. Otherwise the result is 0. 

public int blueTicket(int a, int b, int c) {

int ab = a+b;
int bc = b+c;
int ac = a+c;
// by creating this int values, I am creating the groups ab,bc, and ac. I can later use these. The int is the sum of the two numbers.
 
  if (ab == 10 || ac== 10 || bc == 10)
  {
   return 10;
  }
// if either the group ab, ac, or bc is equal to 10, then return value 10.
 
  if (ab == bc + 10 || ab == ac + 10)
  {
   return 5;
  }
// if the condition is that ab is 10 more than bc + 10 or ab is 10 more than ac, then return the value 5.

  return 0;
// if none of the conditions above are true, then return the value 0.
}

I hope to finish Logic 1 next class and start learning strings.

Tuesday, December 2, 2014

Tuesday, December 2nd

Regular class. It was the first one since I came back from Budapest. I went upstairs to sit at the Genius Bar with Tommy. There weren't any customers. I wonder, will there ever be?

I worked with CodingBat as usual.

Today's problem :

Given three ints, a b c, return true if two or more of them have the same rightmost digit. The ints are non-negative. Note: the % "mod" operator computes the remainder, e.g. 17 % 10 is 7. 


public boolean lastDigit(int a, int b, int c) {
  
/**
When we are trying to isolate the rightmost digit, we can always divide by 10 and then the remainder will always be the rightmost digit. That is why I am always using percent mod with 10.
/
  if ( a%10 == b%10)
  {
  return true;
  }
// If the rightmost digit of int a is equal to the rightmost digit of int b, then return true.

  
  if ( c%10 == b%10)
  {
  return true;
  }
  // If the rightmost digit of int c is equal to the rightmost digit of int b, then return true.

  if ( a%10 == c%10)
  {
  return true;
  }
// If the rightmost digit of int a is equal to the rightmost digit of int c, then return true.

  
  return false;
// if none of the rightmost digits are the same, then return false, because it is a boolean and if it can't be returned true then it must be returned false.
}

Next week is the Hour of Code week, and I am looking forward to that. Although I won't be able to help as middle schoolers have lunch during my free block, I will definitely stop by to see what it's like. It seems interesting.