View
 

Lab 14: Solar System

Page history last edited by Mr. Kretsch 3 months, 3 weeks ago

Name: __________________

Quiz

1. Method that initializes a class is called: ________________________________________

2. To protect an object variable from an invalid value you write a _____________________ method

3. class:object = script:____________________________

Lab Instructions

  1. Create a project called SolarSystem

  2. Import the files from R:\AP Java\Projects\Lab 14 Solar System. The files you will be importing include the Main and template files for the celestial object classes.

  3. Complete the object classes according to the following description:
    1. Rocky planets have several attributes

      1. Are represented by an earth-tone circle..

      2. Have a circular moon

    1. Rocky planets have several behaviours 

      1. Can return their location to the client

      2. Can move

      3. Can report whether they contain a location

      4. Can be toggled, which changes the moon, somehow.

    2. Gaseous planets have several attributes:

      1. Are represented by a sky-tone circle.

      2. Have a circular ring around the planet

      3. Have  location

    3. Gaseous planets have several behaviors 

      1. Can return their attributes to the client
      2. Can move

      3. Can report whether they contain a location

      4. Can be toggled, which changes the ring, somehow

  1. Modify the applet code in Main to do the following.

    1. Create one rocky and one gaseous planet at the start of the program

    2. If the user clicks on a planet, toggle it.

    3. If the user clicks on the background, create a new planet at the clicked location. Althernate between the two planet types.

  2. Print and hand in these instructions.

Grading

 

  Points Out of Notes

Quiz

 

 

Rocky Class

  • Data

  • Methods

 

 

Gaseous Class

  • Data

  • Methods

 

 

Applet behavior

 

6

 

Total

 

25

 

Notes

 
 
 
 
 
 
 

 

 

 

Comments (0)

You don't have permission to comment on this page.