The setup
Start by creating a project that contains the following two classes. You should be able to determine the appropriate class and package names from the first two lines of non-commented Java in the files.
The task
Within the PracticalSpring2013
there are comments
(which are repeated below)
giving four small changes to be made to PracticalSpring2013
Make these changes to your program.
- Create an object of type
Size
. - Use the
nextInt
method ofstdin
to read an integer. Store the integer into a variable namedtheLength
. - Use the
setLength
method of yourSize
object to set the length of your object totheLength
. - Use the
getLength
method ofSize
and theprintln
method ofSystem.out
to print the length of yourSize
object.
The upload
When you are done upload a ZIPed copy of your project to the IDE Practical dropoff on moodle.