Calculate total surface area of Hemisphere in java

In this post, we will see how to calculate total surface area of Hemisphere in java.

Hemisphere is exactly half of sphere.

There can be many practical examples of Hemisphere. You can divide earth into two hemisphere i.e. Northen Hemisphere and Southern Hemisphere.

Hemisphere

Formula of calculating total surface area of Hemisphere is:

surface area of Hemisphere = 2 *Π * r * r
Where r is radius of hemisphere.

Here is java program to calculate total surface area of Hemisphere. We are using scanner class to take input from user in below program.

package org.arpit.java2blog;

import java.util.Scanner;

public class TotalSurfaceAreaHemisphereMain {

    public static void main(String[] args) {

         Scanner s= new Scanner(System.in);

         System.out.println("Enter the radius of hemisphere :");

         double r=s.nextDouble();

         double surfaceAreaHemisphere= 2 * Math.PI * r * r;

         System.out.println("Total surface area of Hemisphere is: "+surfaceAreaHemisphere);

         s.close();
    }

}

When you run above program, you will get below output

Enter the radius of hemisphere :
3
Total surface area of Hemisphere is: 56.548667764616276

That’s all about how to calculate total surface area Hemisphere in java.

[social_share share_on="facebook,twitter,linkedin,whatsapp"][post_navigator in_same_term="true"]

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.