answer batao ;-; plz
Attachments:
Answers
Answered by
0
int r = 5 ;
int h = 6 ;
float pi = 22/7 ;
public void calc(){
float ar = (pi*r*r) + (2*pi*r*h) ;
System.out.println(ar) ;
}
Answered by
2
Program
import java.util.Scanner;
public class SurfaceArea {
public static void main(String[ ] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter :\n Radius - ");
double radius = sc.nextDouble( );
System.out.print(" Height - ");
double height = sc.nextDouble( ),
surfaceArea = Math.PI * radius * radius + 2 * Math.PI * radius * height;
System.out.println("Surface area - " + surfaceArea + " unit square");
}
}
Algorithm
- Accepting the radius and height from the user using Scanner class.
- Calculating the surface area of a cylinder using the provided formula.
- Displaying the surface area of the cylinder.
Attachments:
Similar questions
Physics,
1 month ago
Math,
1 month ago
English,
3 months ago
Math,
9 months ago
Business Studies,
9 months ago