Java OOP GUIDE / WORK PRISM CLASS Topics
TASK –
PART 1 – SETUP Copy and
paste the following incomplete class into your IDE:
TASK –
PART 2 – COMPLETE THE CLASS Make the
following completions/additions: a) Write the
statements required to implement the first constructor. b) Write the
statements required to implement the 2nd constructor. It should give random values between 0 and
10 for each length.
|
|
e) Write a toString() method that returns a String of the form: TASK –
PART 3 – TESTING THE CLASS a) Create a
tester class with a main function. b) Write a
statement needed to create a Prism with constructor #1. Output the object to the screen (using toString()). c) Write a
statement needed to create a Prism with constructor #2. Output the object to the screen (using toString()). d) Test both
the volume method and the maxSide method. |