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:
getWidth() Gets the width of this Window (provided)getHeight() Gets the height of this Window (provided)setDimensions(double theWidth, double theHeight) sets a new width and height for the windowgetArea() Gets the area of the window in square inches (updated sept 20)getCostOfGlaze() Gets the cost of the glaze needed for this window. So not calculate the area again in this method. Call another method in the class.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;
If you have forgotten what a stub is, look here.

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..
System.out.print("Enter a word: ");next method to get the wordSystem.out.print("Enter a double: ");Scanner's nextDouble method to get the doubleSystem.out.print("Enter an integer: ");Scanner's nextInt method to get the integerOnly 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).
public Monogram(String theFirst, String theMiddleInitial, String theLast) initializes the instance variables with the values of the parameters. The user is supposed to supply a single character for theMiddleInitial. But users often do not do what they should. A good program protects itself from user error. So use the substring method to get just the first character of theMiddleInitial and store that in the instance variable. Now your program will work, even it the user makes a mistake.public Monogram(String theFirst, String theLast) initializes the first and last names to the given parameters and initializes the middle initial to the empty String (two double quotes with no space like this "")Letters class has these methods
public String getFirstName()public String getMiddleInitial()public String getLastName()public String getName() gets the full name with spaces separating the names. Note: When the there is no middle initial, there will be 2 spaces between first and last name. That is okay.public String getMonogram() gets the letters comprising the initials (first initial, middle initial, last initial) with no spaces. Do not use an if statement. You do not need it. The middle initial is either a string of one character of the empty string.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.