Question: Part 1: Code a rectangle class that has the following fields: width: double height: double The class should have the following methods: width and height

Part 1: Code a rectangle class that has the following fields: width: double height: double The class should have the following methods:

width and height of the rectangle as arguments.

setWidthand setHeight: Mutator methods for setting these two fields.

getWidthand getHeight: A accessor method for returning the radius field.

compputeCircumferenceComputes the circumference of the rectangle and returns it.

computeArea: Computes the area of the rectangle returns it. area = width * height

Then code a testing class (driver class) RectangleApp that tests the rectangle class by asking the user to enter the width and height of a rectangle, creating an object and call its methods to pass the input data, displaying the values of input data and computed results, respectively.

Coding Requirements:

Must use required/meaningful names for fields, variables, methods, and classes.

Must document each of your source code

Must separate operation class Rectangle from the driver class RectangleApp.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!