Free Data Structures and Algorithms Course









Subscribe below and get all best seller courses for free !!!










OR



Subscribe to all free courses

How to calculate Volume, Curved Surface Area and Total Surface Area of Hemisphere in Java ?

Program to calculate Volume, Curved Surface Area and Total Surface Area of Hemisphere in Java

package com.hubberspot.mensuration.example;

import java.util.Scanner;

public class Hemisphere {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    double radius = 0;
  
    double volume = 0;
    double curvedSurfaceArea = 0;
    double totalSurfaceArea = 0;

    System.out.print("Enter the radius of Hemisphere : "); 
    radius = input.nextDouble();

    volume = (2 * Math.PI * radius * radius * radius) / 3;
  
    curvedSurfaceArea = 2 * (Math.PI * radius * radius);
  
    totalSurfaceArea = 3 * (Math.PI * radius * radius);

    System.out.println("");
    System.out.println("The Volume of Hemisphere is : " + volume);
    System.out.println("The Curved Surface Area of Hemisphere is : "
   + curvedSurfaceArea);
    System.out.println("The Total Surface Area of Hemisphere is : "
   + totalSurfaceArea);


  }

}

Output of the program : 


 
© 2021 Learn Java by Examples Template by Hubberspot