Question: /** * This class converts the size of letters. * */ public class LetterSize { //TODO: Declare required instance variables public LetterSize(double widthInInches, double heightInInches)
/**
* This class converts the size of letters.
*
*/
public class LetterSize {
//TODO: Declare required instance variables
public LetterSize(double widthInInches, double heightInInches) {
//TODO: Initialize object state
}
public double getWidthInMillimeters() {
}
public double getHeightInMillimeters() {
}
}
```
In this case you'll notice that not only do we have a code skeleton but the methods don't have any documentation. **You'll have to add the proper Javadoc documentation** as well as the proper code to solve the problem. You will have to add instance variables, a constant, and code to get this class defined properly. Read the comments (and the problem) to understand what the problem is and how you will solve it. Please note that the UML diagram provides some guidance such as *in which unit of measurement the height and width will be stored*.
Next, using the same techique you used to create the **LetterSize.java** file to create another file called Program**.java**. This is where your test code will go. Replace the code in that file with the code in the grey box below:
/**
* This class tests the LetterSize object.
*
*/
public class Program {
/**
* Test this code by creating an 8.5 x 11 inch letter and getting the size
* in millimeters.
*
* @param args
* command line values. Not used in this example.
*/
public static void main(String[] args) {
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
