|
|
This is similar to programming challenge 7, from our book (page 106).
For this assignment you are going to write the code for the following class:
Here are the specifications of class LandCalculation:
LandCalculation does not have any INSTANCE variables.
Methods of class LandCalculation:
feetToAcres
returns: a double (that we will call here acres)
arguments: a double (that we will call here feet)
what it does: it computes the number of acres equivalent to the number of square feet and returns it as its value.
HINT: one acre equals 43560 square feet.
Examples:
- feetToAcres(435600.0) returns 10
- feetToAcres(871200.0) returns 20
These are only two examples, your code must work for any number of feet that can be stored in a java variable of type double.
Read the instructions carefully:
- create a folder called Assignment06
- create a file called LandCalculation.java and save it in folder Assignment06
- download file Test06.class.zip (Test06_java6.class.zip) and put it in your folder Assignment06
- compile all java files in folder Assignment06
- type the following command in the DOS prompt window:
java Test06
- tests will be run on your code and appropriate messages will be printed out showing which tests passed and which failed. At the end the program will tell you which option to choose in the moodle quizz corresponding to programming exercise 06
|
|
|