Greenfoot Ch 3 Practice

12 Questions | Total Attempts: 469

SettingsSettingsSettings
Please wait...
Greenfoot Quizzes & Trivia

Practice over Ch 3 and notes


Questions and Answers
  • 1. 
    Using a dot between a class name and a method name is called ____ ____.
  • 2. 
    What class is this method from? static int getRandomNumber(int limit)
  • 3. 
    Write a method call that will return a random integer between 0 and 10.                                         
    • A. 

      Greenfoot.getRandomNumber(10)< 1;

    • B. 

      Greenfoot.getRandomNumber(100) < 10;

    • C. 

      Greenfoot.getRandomNumber(10);

    • D. 

      Greenfoot.getRandomNumber(10)+1;

  • 4. 
      Methods that belong to classes (as opposed to objects) are marked with the keyword static in their signature.
    • A. 

      True

    • B. 

      False

  • 5. 
    How would I write a random number that would show numbers from 1 to 8?
    • A. 

      Greenfoot.getRandomNumber(8) + 1;

    • B. 

      Greenfoot.getRandomNumber(8);

    • C. 

      Greenfoot.getRandomNumber(1) + 8;

  • 6. 
    Write an if statement that tells an object to turn  17 degrees,  but only 31 percent of the time.
    • A. 

      if (Greenfoot.getRandomNumber(100)

    • B. 

      if (Greenfoot.getRandomNumber(100)

    • C. 

      if Greenfoot.getRandomNumber(100)

  • 7. 
    This statement  tells an object to turn a random number of degrees between -20 and 20.        Greenfoot.getRandomNumber(-20, 20);
    • A. 

      True

    • B. 

      False

  • 8. 
    It is good naming convention to  name a class in Greenfoot “crab” .
    • A. 

      True

    • B. 

      False

  • 9. 
    Single line comment tags are written with ____
  • 10. 
    Which are correct ways to indicate 25%
    • A. 

      GetRandomNumber(16) < 4

    • B. 

      GetRandomNumber(100) < 25

    • C. 

      GetRandomNumber(4) < 1

  • 11. 
    Strings are indicated with double quotes.
    • A. 

      True

    • B. 

      False

Back to Top Back to top