Java icon indicating copy to clipboard operation
Java copied to clipboard

Fix this pls

Open Sree-Ram-MS opened this issue 2 years ago • 3 comments

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(); } }

Sree-Ram-MS avatar Mar 06 '22 10:03 Sree-Ram-MS

Hello brother, I would love to work on this issue. Can you please assign this task to me?

AniketNS avatar Nov 12 '22 12:11 AniketNS

Hey! I'd be eager to solve this issue. If you could assign this task to me

oohsai avatar Jul 31 '23 10:07 oohsai

any one working on this

AryamanDhoundiyal avatar Sep 06 '23 06:09 AryamanDhoundiyal