22 Matching Annotations
  1. Dec 2022
    1. e following has the correct code to ‘swap’ the values in x and y (so that x ends up with y’s initial value and y ends up with x’s initial value), but the code is mixed up and contains one extra block which is not needed in a correct solution. Drag the needed blocks from the left into the correct order on the right. Check your solution by clicking on the Check button. You will be told if any of the blocks are in the wrong order or if you need to remove one or more blocks. After three incorrect attempts you will be able to use the Help Me button to make the problem easier.

      good question

  2. Nov 2022
    1. Pass by value¶ Java uses pass by Value when it passes arguments into a method. This means that a copy of the actual parameter value is stored in the formal parameter variable. The original value outside the method is not changed if a new value is assigned to the formal parameter within the method body. It is generally not a good idea to change the value of a formal parameter inside a method, however it is possible as the example below shows.

      ASK DIANA

    1. To draw something on the screen you would first set the pen color: StdDraw.setPenColor(Color.GREEN); //or use a custom color here! You can then use one of the API methods to draw something on the canvas: StdDraw.filledSquare(0.5, 0.5, 0.2);

      VERY VERY FUCKING IMPORTANT!!! PRACTICE IT AGAIN AND AGAIN!!

    1. One powerful feature in the array data abstraction is that we can use variables for the index! As long as the variable holds an integer, we can use it as an index.

      Ask Ethan to explain this

    1. Watch the following video for a tracing demo. When you are tracing through code, pretend to be the computer running the code line by line, repeating the code in the loop, and keeping track of the variable values and output.

      VERY FUCKING IMPORTANT FOR THE FINAL!!! CHECK IT AGAIN AND AGAIN

  3. Sep 2022
    1. String is an object type and is the name of a class in Java. A string object has a sequence of characters enclosed in a pair of double quotes - like “Hello”.

      very important

    1. 5: Fill in the blank with code to access the cars array.

      solve this again, did solve this but not clear silly mistake the combination starts from 0

    1. 1-6-3: Which of the following returns the correct average for a total that is the sum of 3 int values?

      good question, must check before the exam

    2. ✔️ Java throws away any values after the decimal point if you do integer division. It does not round up automatically.

      VERY IMPORTANT POINT! MUST REMEMBER! HUGE DIFF BETWEEN THROW AWAY AND ROUNDS OFF