Question: [IN JAVA] Can I get some help typing this out to look off of as a reference. I typed mine up but there are all

[IN JAVA] Can I get some help typing this out to look off of as a reference. I typed mine up but there are all sorts of mistakes and I cannot seem to figure out what is wrong at all. Thanks in advance. The Main is copyable below the picture and includes commented out directions.

[IN JAVA] Can I get some help typing this out to look

-MAIN CLASS -

public class Main {

public static void main(String [] args) { // Declare any variables you need here

// Create an object called rect1 of the rectangle class // Use the constructor with no formal parameters

// Create an object called rect2 of the rectangle class // Make the length be 5.2 and the width be 8.6

// Ask the user to type in a length and width and // create an object called rect3 of the rectangle class // Make sure you have an import and declare your Scanner object // See output for format

// Using the member function in the class, print rect1, rect2, // and rect3 details (in that order) - it should look like output

// Write an if statement to determine if the area of // rectangle 3 is more than 100. It will print one of the // following "Rectangle 3 area is more than 100" or // "Rectangle 3 area is less than 100"

} }

Create the class described by the UML and directions givern below Rectangle Report Dimensions: 0.0 x 0.0 Area: 0.0 Perimeter: 0.0 Test each method as you enter it by using main and calling it Once you have finished the class and tested it, create a Main class and copy the following code into it. Follow the comments to produce the output below Rectangle Output 1 Enter the length of rectangle 3 15 Enter the width of rectangle 3 8.5 length: double width: double 1 +Rectangle(newlength: double, newWidth: double) Rectangle Report Dimensions: 0.0 x 0.0 Area: 0.0 Perimeter: 0.0 +setLength(length: double): void +setWidth(width: double): void +getLength) double +getWidth0double Rectangle Report Dimensions: 5.2 x 8.6 Area: 44.7 Perimeter 27.6 +computeArea) double +computePerimeter): double +printDetails0 void Create the class using three files - a h, a cpp and a main.cpp Rectangle Report Dimensions: 15.0 x 8.5 Area: 127.5 Perimeter 47.0 Constructor with no arguments o sets all numbers to 0 Constructor with arguments o Sets the length and width to the values passed in .Get methods (accessors) return the field that the get refers to 1 .Set methods (mutators) set the field to the new values passed in to it Rectangle 3 area is more than 100 computeArea - computes the area of the rectangle .computePerimeter computes the perimeter of the rectangle printDetails - prints the information as shown below (there are 20 asterisks) it should call the methods computePerimeter and

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!