55 Code Project Shapes
I have no idea what I am doing wrong, also I don't know how to use Math.PI so I used the numbers 3.14159 instead import java.util.Scanner; abstract class Shape { int width; abstract void area(); } //your code goes here class Square extends Shape { public void area(){ int Sq_answer = x*x; System.out.println(Sq_answer); } } class Circle extends Shape { public void area(){ Double Cir_answer = 3.14159*y*y; System.out.println(Cir_answer); } } public class Program { public static void main(String[ ] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); Square a = new Square(x); Circle b = new Circle(y); a.area(); b.area(); } }