PLZ HELP ASAP
package lesson8;
public abstract class Shape {
protected int h...
Computers and Technology, 23.05.2020 05:04 brandy127
PLZ HELP ASAP
package lesson8;
public abstract class Shape {
protected int height;
protected int width;
public Shape(int height, int width) {
this. height = height;
this. width = width;
}
public final void printArea() {
System. out. println("This " + getName() + " has a height of " +
height + ", a width of " + width + ", and an area of " +
getArea() + ".");
}
public final void printPerimeter() {
System. out. println("This " + getName() + " has a height of " +
height + ", a width of " + width + ", and a perimeter of " +
getPerimeter() + ".");
}
protected abstract String getName();
protected abstract double getArea();
protected abstract double getPerimeter();
}
Rectangle Class
package lesson8;
public class Rectangle extends Shape {
public Rectangle(int height, int width) {
super(height, width);
}
protected String getName() {
return "rectangle";
}
protected double getArea() {
return height * width;
}
protected double getPerimeter() {
return height * 2 + width * 2;
}
}
RightTriangle Class
package lesson8;
public class RightTriangle extends Shape {
public RightTriangle(int height, int width) {
super(height, width);
}
protected String getName() {
return "right triangle";
}
protected double getArea() {
return height * width / 2;
}
protected double getPerimeter() {
return height + width + Math. sqrt(height * height + width * width);
}
}
Square Class
package lesson8;
public class Square extends Rectangle {
public Square(int height) {
super(height, height);
}
protected String getName() {
return "square";
}
}
Answers: 1
Computers and Technology, 23.06.2019 08:30, mai1261
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
Computers and Technology, 23.06.2019 16:30, azainababbas
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
Mathematics, 28.11.2019 19:31
History, 28.11.2019 19:31
English, 28.11.2019 19:31
Mathematics, 28.11.2019 19:31