Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use Eclipse as Java . Part I: Code a Rectangle class that has the following fields: width : double Height: double The class should have

use Eclipse as Java .
Part I: Code a Rectangle class that has the following fields: width : double
Height: double
The class should have the following methods:
Constructor: Accepts the width and height of the rectangle as arguments.
setWidth and setHeight: Mutator methods for setting these two fields.
getWidth and getHeight: A accessor method for returning the radius field.
compputeCircumference Computes 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 (see example in the next slide)
Must separate operation class Rectangle from the driver cla.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions