subject

How do i fix this to make it run ??? class Main {
public static void main(String[] args) {

// Length and sides.

Cube shape1 = new Cube(5, 6);

HalfSquare shape3 = new HalfSquare(4, 20, 4, 5);

// Cluster of print statements to deliver stats about the shape.

// Shape 1
System. out. println(shape1.toString());
System. out. println("");
System. out. println(shape1.toStringCube());
System. out. println("");

// Shape 2
System. out. println("");
System. out. println(shape3.toString());
System. out. println("");
System. out. println(shape3.toStringHalfSquare() );

}
}

// Main Class
class Shapes {

private int sidesNum;
// Constructors, Mutators, and Accessors
public Shapes(int SN){
setSidesNum(SN);
}
public void setSidesNum(int value){
this. sidesNum = value;
return;
}
public int sideNumber(){
return this. sidesNum;
}

// shapes, shapes, and more shapes
public String toString() {
return " This shape has: " + sideNumber() + " sides.";
}
}

class Cube extends Shapes{
private int volume;

// Constructors, Mutators, and Accessors
public Cube(int Vol, int SN){
super(SN);
setVolume(Vol);
}

public void setVolume(int value){
this. volume = value;
return;
}

public int getVolume(){
return this. volume;
}

public String toStringCube() {
return " " + "Volume of a cube = " + Math. pow(getVolume(), 3 ) + " squared. Surface area = " + Math. pow(getVolume(), 2) * sideNumber() + " units2.";
}

}

class HalfSquare extends Shapes{
private int length;
private int width;
private int height;

// Constructors, Mutators, and Accessors
public HalfSquare(int lngh, int hght, int wdt, int SN){

super(SN);
setLength(lngh);
setHeight(hght);
setWidth(wdt);
}
public void setLength(int value5){
this. length = value5;
return;
}
public void setWidth(int value6){
this. width = value6;
return;
}
public void setHeight(int value7){
this. height = value7;
return;
}
public int getLength(){
return this. length;
}
public int getWidth(){
return this. width;
}
public int getHeight(){
return this. height;
}
public String toStringhalfSquare() {
double hypot = (Math. sqrt((getLength() * getLength()) + (getHeight() * getHeight(;
return "The volume of a prism = " + (getLength() * getWidth() * getHeight()) * .5 + " squared. The hypotenuse = " + hypot + ", The surface area =" + ((getLength() * getHeight()) + (hypot * getWidth()) + getHeight() * getWidth() ) + " units2";
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
question
Computers and Technology, 24.06.2019 23:30
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
You know the right answer?
How do i fix this to make it run ??? class Main {
public static void main(String[] args) {
Questions
question
Mathematics, 22.07.2021 03:20
question
Mathematics, 22.07.2021 03:20
Questions on the website: 13722362