CS49J

Remember not to create packages. Use the default package

5A

You have a business painting the insides of planetariums with a special, expensive paint. A planetarium is a circular room with a domed roof (a hemisphere) You charges $95.50 a gallon for paint and a gallon will cover 40 square feet. (If we need a fractional gallon of paint, we only charge for what we use since we can use the remainder on another job)

You paint both the cylinder and the hemisphere.

You charge $100 per square yard for labor plus the cost of the paint.

Your job in this program is to finish the class, PaintJob which can be used to calculate the price you need to charge the customer.

The constructor takes the height and radius of the cylindrical part of the room as parameters in that order. (Call them height and radius so the provided methods will work)

You will write methods:

Provide Javadoc for the class, the constructor, every method, every parameter and every return value..

Declare and use constants for the price of a gallon of paint, the number of square feet it will cover, and the price you charge per square yard as constants.

Declare a constant using  public static final ...

Notice you will need to convert units from square feet to square yards to calculate the labor cost. Use the constant provided in the starter file.


Codecheck URL

5B

Stamps R Us makes rubber stamps consisting of a person's initials. You are to write a class Stamp. A Stamp has instance variables of a first name, middle initial (one letter. No period), and last name.

There is no starter file. You will write the whole class.

The Stamp class has two constructors (This is called overloading).

Stamp class has these methods

Do not use an if statement. You do not need it.

Provide full Javadoc (the class, the constructors, and the methods)

Codecheck URL

5C

Write a class AmazonOrder which keeps track of the items a person orders on Amazon. We want to be able to add an item of a specific cost and remove an item of a specific cost. We also want to able able to get the subtotal, total and a string representation of the contents of the AmazonOrder

AmazonOrder has a no-argument constructor which initializes the instance variables (subtotal to 0, contents to the empty string)

It has the following methods:

To add to the order: add the string Add Item or Remove Item, a colon, a space, and then the value of the transaction and a newline

The format of the string returned by getContents:

Add Item: 2.59
Add Item: 8.25
Remove Item: 2.59
Total: 8.95125

The total is displayed at the end.

NOTE: I should get the same output if I call getContents() twice in a row.

You need to provide a Javadoc comment for your all methods, the constructor and the class itself.

Codecheck URL