Hi guys,
I've been trying to help a friend with Java programming but have to admit I really don't know much about it, and he's struggling a lot. He's trying to teach himself some Java before beginning what sounds like a rather advanced college course in Computing Science. Here's the task we've been trying to figure out:
"Design and implement a Java Class to represent a rectangle. You should provide two Constructors for the Class, the first being the default constructor and the second which takes the basic dimensions and sets up the private member variables with the appropriate initial values. Member functions should be provided that allow a user of the Class to find out the area and perimeter of the shape plus a showDetails()method to print the values of the basic dimensions."
Does anyone have any idea where to start? I'm afraid I'm completely lost.
Thank-you in advance for any suggestions.
Tom
I've been trying to help a friend with Java programming but have to admit I really don't know much about it, and he's struggling a lot. He's trying to teach himself some Java before beginning what sounds like a rather advanced college course in Computing Science. Here's the task we've been trying to figure out:
"Design and implement a Java Class to represent a rectangle. You should provide two Constructors for the Class, the first being the default constructor and the second which takes the basic dimensions and sets up the private member variables with the appropriate initial values. Member functions should be provided that allow a user of the Class to find out the area and perimeter of the shape plus a showDetails()method to print the values of the basic dimensions."
Does anyone have any idea where to start? I'm afraid I'm completely lost.
Thank-you in advance for any suggestions.
Tom