For your homework, write a program that computes the surface area of a cylinder. Your program should read in the height of the cylinder and radius of the base, and it should both compute and output the surface area of the cylinder (being as exact as possible). Comment your solution here.
top of page
bottom of page
class Main {
public static void main(String[] args) {
double h = 7.5;
double r = 8;
double sa = Math.PI * h * r * 2 + Math.PI * 2 * r * r;
System.out.println(sa); }
}