Well I've reached the end of another chapter and I need to see how to do a couple applications. I posted the Console one already and now for the GUI based one.
For this project, you'll write a set of classes that use apply inheritance principles.
Write a class named Rectangle. This class should have data fields for:
* length
* width
Also provide the following methods:
* A way to get and set each of these fields
* a constructor that takes values to initialize the length and width fields
* a method that will return the area of the Rectangle (length times width)
* a ToString method that will return a description of the Rectangle as a String.
NOTE: Your program will not be drawing the Rectangle, only providing a way to represent it.
Once you have your Rectangle class working correctly, write a child class of Rectangle, named Box. This class should have one additional data field:
* height
Also provide the following methods:
* a way to get and set the value of height
* a constructor that takes values for length, width and height
* a method that returns the volume (length times width times height)
* a ToString method that returns a String representation of the Box
Last edited by a moderator: