Closed.

Status
Not open for further replies.
Java:
import java.util.Scanner;
class Gravitational
{
 public static void main(String[] args)
 {
 Scanner in = new Scanner (System.in);
 
 double GPE = 0;
 double m = 0;
 double h = 0;
 
 System.out.println("Mass:");
 m = in.nextDouble();
 System.out.println("Height/Distance of reference point:");
 h = in.nextDouble();
 
 GPE = m * 9.8 * h;
 
 System.out.println("Gravitational Potential Energy:" + GPE);
 }
}

pa try ako ts
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 2
    Replies
  • 304
    Views
  • 3
    Participants
Last reply from:
Accenture

Trending Topics

Online now

Members online
911
Guests online
13,799
Total visitors
14,710

Forum statistics

Threads
2,364,908
Posts
29,427,890
Members
1,048,875
Latest member
Oldmaster12
Back
Top