Java
Java copied to clipboard
Fix this pls
import java.util.Scanner; interface Volume { double pi=3.14; void readdata(); void dispvolume(); } class Sphere implements Volume { double r=0,vol; public void readdata() {
Scanner input=new Scanner(System.in);
System.out.print("Enter the radius of the Sphere :");
r=input.nextDouble();
}
public void dispvolume()
{
vol=(4/33.14rrr);
System.out.println("Volume of Sphere : "+vol);
}
}
class Cylinder implements Volume
{
double R,h,vol;
public void readdata()
{
Scanner input=new Scanner(System.in);
System.out.print("Enter the radius of the Cylinder :");
R=input.nextDouble();
System.out.print("Enter the height of the Cylinder :");
h=input.nextDouble();
}
public void dispvolume()
{
vol=piRR*h;
System.out.println("Volume of the Cylinder: "+vol);
} } public class VolumeMain { public static void main(String args[]) { Sphere obj=new Sphere(); obj.readdata(); obj.dispvolume(); Cylinder obj1=new Cylinder(); obj1.readdata(); obj1.dispvolume(); } }
Hello brother, I would love to work on this issue. Can you please assign this task to me?
Hey! I'd be eager to solve this issue. If you could assign this task to me
any one working on this