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
nextIntmethod ofstdinto read an integer. Store the integer into a variable namedtheLength. - Use the
setLengthmethod of yourSizeobject to set the length of your object totheLength. - Use the
getLengthmethod ofSizeand theprintlnmethod ofSystem.outto print the length of yourSizeobject.
The upload
When you are done upload a ZIPed copy of your project to the IDE Practical dropoff on moodle.