Question: Task01: Modified problem E4.1 from Book. Create a class called Paper. Your class should have two instance variables to represent the height and width of

 Task01: Modified problem E4.1 from Book. Create a class called Paper.

Task01: Modified problem E4.1 from Book. Create a class called Paper. Your class should have two instance variables to represent the height and width of the sheet of paper in inches. You should also have a public constant in your class that represents the number of millimeters per inch. (There are 25.4 millimeters per inch ). Create a constructor that accepts two values, the height and width of the paper. Create the following accessor methods: getwidthinMillimeters ( ), getHeightinMillimeters (), getwidthInInches (), getHeightinInches (). Recall that it is OK for an accessor method to calculate a value to return. However, accessor methods should NOT change the value of any instance variables. Create a Paper object in your tester class. Use the dimensions 8.25.3. Test all four methods that you have created. Use printf to limit the number of decimal places in your printout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!