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
  • 285
    Views
  • 3
    Participants
Last reply from:
Accenture

Trending Topics

Online now

Members online
1,185
Guests online
1,995
Total visitors
3,180

Forum statistics

Threads
2,292,518
Posts
29,077,653
Members
1,209,392
Latest member
gettfoutpervs
Back
Top