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

Online now

Members online
665
Guests online
642
Total visitors
1,307

Forum statistics

Threads
2,276,937
Posts
28,973,181
Members
1,230,626
Latest member
ReiAyanami
Back
Top