Shape.java: public class Shape { private double area; public Shape({ area = 0.0; } public Shape(double a){ this.area = a; } public void setArea(double a){ area = a; } public double getArea({ return...


I need help putting this java code into something I can copy/paste .


Here is the code:



Shape.java:<br>public class Shape {<br>private double area;<br>public Shape({<br>area = 0.0;<br>}<br>public Shape(double a){<br>this.area = a;<br>}<br>public void setArea(double a){<br>area = a;<br>}<br>public double getArea({<br>return area;<br>}<br>public String toString({<br>return

Extracted text: Shape.java: public class Shape { private double area; public Shape({ area = 0.0; } public Shape(double a){ this.area = a; } public void setArea(double a){ area = a; } public double getArea({ return area; } public String toString({ return "Shape:\n\tarea: "+ area; } } ShapeDriver.java: public class ShapeDriver { public static void main(String[] args) { Circle cir = new Circle(); cir.setRadius(5.0); System.out.println(cir.toString() + "In\tradius: "+ cir.getRadius(); Cirlce.java: public class Circle extends Shape{ private double radius; private final double PI = 3.17; public void setRadius(double r){ this.radius = r; double area = PI*Math.pow(r,2); setArea(area); } public double getRadius() { return this.radius; }

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here