6A

The Java Beach Resort has two types of rooms: Ocean Side and Street Side. The price is based on the number of occupants and the type. See the table. Complete the class ResortRoom.

  2 people 4 people
Ocean side $250.00 $370.00
Street side $175.00 $260.00

An int is used to represent the type of view. 0 is ocean view and 1 is street side. Use the defined constants to avoid errors

ResortRoom has a constructor that takes two parameters.

If type is other than OCEAN_SIDE or STREET_SIDE, set the type to OCEAN_SIDE.

If the number of occupants is <= 0, set the occupants to 2.

Call the instance variable for the number of occupants occupants. That way the provided getOccupants method will work.

It also has a methods:

The cost is based on the table above. One person costs the same as two people and three people cost the same as 4 people. For more than 4 people, the charge is $100 per each additional person for any room.

Define and use a constant for the cost for an extra person. (What should data type should it be?)

Provide Javadoc

For the draft, implement the constructor and getType method. Provide stub for the getCost and setOccupants methods so that your class will compile with the tester. Provide all the Javadoc

6A draft:
6A final:

6B

Write a class FunWithLoops that contains the methods specified below. There is no constructor or instance variables.

No starter. No Javadoc

For the draft, implement the sumOdd method

6B draft:
6B final:

6C

Complete the class LoopyText which has a constructor that takes a String of text (provided for you). Implement the following methods.

Provide Javadoc

For the draft, implement the getEverySecondCharacter()method

6C draft:
6C final: