Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me write the pseudocode, create a flowchart with the appropriate shapes, and a Test Plan / Test Case Matrix for the following Java

Please help me write the pseudocode, create a flowchart with the appropriate shapes, and a Test Plan/Test Case Matrix for the following Java code.
public class Exercise09_01{
public static void main(String[] args){
// Create a rectangle with width 4 and height 40
Rectangle myRectangle = new Rectangle(4,40);
// Display information about the first rectangle
System.out.println("The area of a rectangle with width "+
myRectangle.getWidth()+" and height "+
myRectangle.getHeight()+" is "+
myRectangle.getArea());
System.out.println("The perimeter of a rectangle is "+
myRectangle.getPerimeter());
// Create another rectangle with width 3.5 and height 35.9
Rectangle yourRectangle = new Rectangle(3.5,35.9);
// Display information about the second rectangle
System.out.println("The area of a rectangle with width "+
yourRectangle.getWidth()+" and height "+
yourRectangle.getHeight()+" is "+
yourRectangle.getArea());
System.out.println("The perimeter of a rectangle is "+
yourRectangle.getPerimeter());
}
}
class Rectangle {
private double width;
private double height;
// No-arg constructor to create a default rectangle
public Rectangle(){
this.width =1.0;
this.height =1.0;
}
// Constructor with specified width and height
public Rectangle(double width, double height){
this.width = width;
this.height = height;
}
// Getter method for width
public double getWidth(){
return width;
}
// Getter method for height
public double getHeight(){
return height;
}
// Method to calculate and return the area of the rectangle
public double getArea(){
return width * height;
}
// Method to calculate and return the perimeter of the rectangle
public double getPerimeter(){
return 2*(width + height);
}
}

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_2

Step: 3

blur-text-image_3

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago