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, 22.06.2019 06:00
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Consider jasper’s balance sheet. which shows how to calculate jasper’s net worth?
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
Business, 24.06.2019 10:30
question
Social Studies, 24.06.2019 10:30
Questions on the website: 13722360