Activity R7-1 *** Portfolio Activity ***1. Declare and initialise a String array called names with the names of three of yourclassmates, or if you are an Online student, three of the names from one of the lectures.2. Write the code that will play a sound "ouch.wav" 20 times, using a while loop.3. Consider the following code:int x = 3;int i = 0;while (i <>{x = x + 1;i = i + 1;}What is the value of x after this code has executed?Place your answers to this exercise in your portfolio document under the heading "ActivityR7-1".
Activity R8-1 *** Portfolio Activity ***1. Declare and initialise a String array called names with the names of three of yourclassmates, or if you are an Online student, three of the names from one of the lectures.2. Write the Java/Greenfoot code (not in Greenfoot itself) that will loop through this array,showing each of the names using the showText method, in a different location each time.3. Write a loop that will add the even numbers from 2 to 2000.4. Write a FOR loop that will display the numbers from 199 down to 100.Place your answers to this exercise in your portfolio document under the heading "ActivityR8-1".
Activity R9-1In your Autumn scenario, introduce a new class called Apple. Give it an Apple image. Write code inthe MyWorld class to place 12 apples at random locations.Activity R9-2Write code In your Block class to turn all apples by 90 degrees whenever the block hits the edge ofthe world.Activity R9-3Create another class: Pear. Use a suitable image. Write code to place 8 pears into the world. Writecode in the Block class so that every time the block hits the edge all pears are moved 20 cells tothe right (in addition to turning the apples)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here