Question: Hello, I want the return statement to be printed out. But only the # of desks are currently being printed out as you can see

Hello, I want the return statement to be printed out. But only the # of desks are currently being printed out as you can see in the output. How do I get the return statement from Rectangle.java to be printed to the screen? 2.6.4 Desks in a Room
Main.java
Rectangle java
1 public class Main
1
public static void main(String[] args)
{
//step 1: find the total area of the space
int totalArea =200*114;
//step 2: find the area of a desk
Rectangle desk = new Rectangle(13,7);
int deskArea = desk.getArea():
//step 3: divide the area of space by the area of a desk
int numDesks = totalArea ?? deskArea;
//step 4: print out the number of desks!
Systen. out.print ln(numDesks);
}
}
I
2.6.4 Desks in a Room
Main.java
Rectangle.java
1 public class Rectangle
2.{
private int width;
private int height;
public Rectangle(int rectwidth, int rectHeight)
{
width = rectWidth;
height = rectHeight;
}
public void printArea()
{
int area = width * height;
Systen.out.println(area);
}
public int getArea()
{
int area = width * height;
return area;
}
public void setHeight(int newHeight)
{
}
height = newHeight;
public void setwidth(int newwidth)
{
}
width = newWidth;
public String toString()
{
}
return "Rectangle with width: "+ width +" and height: "+ height;
}2.6.4 Desks in a Room
public static void main(String[] args)
{
//step 1: find the total area of the space
int totalArea =200*114;
//step 2: find the area of a desk
Rectangle desk = new Rectangle(13,7);
int deskArea = desk.getArea();
//step 3: divide the area of space by the area of a desk
int numDesks = totalArea / deskArea;
//step 4: print out the number of desks!
System.out.println(numDesks);
}
} public class Rectangle
{privateintwidth;
private int height;
public Rectangle(int rectWidth, int rectHeight)
{
width = rectWidth;
height = rectHeight;
}
public void printArea()
{
int area = width * height;
System.out.println(area);
}
public int getArea()
{
int area = width * height;
return area;
}
public void setHeight(int newHeight)
{
}
height = newHeight;
public void setWidth(int newWidth)
{
}
width = newWidth;
public String toString()
{
}
return "Rectangle with width: "+ width +" and height: "+ height;
}
Hello, I want the return statement to be printed

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 Programming Questions!