4A

At Windows, Inc., we make stain glass windows of one particular shape. The windows are rectangular with a semi-circle on top. There is an image below. We put a glaze on the surface of the window. The glaze costs $2.54 a fluid ounce, and a fluid ounce will cover 10 square inches.

Complete the Window class. It has a constructor that takes the width and height (in feet) of the rectangular part of the window(in that order) as parameters. Instance variables are already defined

Implement the following methods:

Note: the width of the rectangle is also the diameter of the semi-circle.
Note: you will have to do some units conversion.

Use Math.PI

Do not use magic numbers in your code. Use constants provided for number of square inches in a square foot, for the number of square inches an ounce will cover, and for cost of the glaze per ounce. The constant for in²/ft² is below. You provide the one for cost of the glaze per ounce

public static final double COST_PER_OUNCE = 2.54;
public static final int SQUARE_INCHES_PER_SQUARE_FOOT = 144;
public final static int SQUARE_INCHES_PER_OUNCE_OF_GLAZE = 10;

For the draft, write the constructor and provide setDimensions method. Code the other methods as stubs. Provide Javadoc

If you have forgotten what a stub is, look here.

window

4A draft:
4A final: (updated Sept 1)

4B

Write an application InputApplication. (An application has a main method.)

Create a Scanner object and do the following..

Only create one Scanner.

For the draft, create the Scanner and do the first three steps.

4B draft: (URL changed Sept14)
4B final:

4C

Sometimes people have their initials printed on things like towels, shirts, and glassware. These initials are called a monogram. You are to write a class Monogram which represents a person's initials. A Monogram class has String 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 Monogram class has two constructors (This is called overloading).

Letters class has these methods

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

To get the first letter of a string, you can use substring

    String firstLetter = word.substring(0, 1);

For the draft, provide the instance variables and the first constructor. Implement these methods: getFirstName, getMiddleInitial, and getLastName methods. Implement the other methods as stubs. Provide Javadoc. For the stubs, indicate what will be returned in the final not null.

4C draft:
4C final: