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

Trending Topics

Online now

Members online
531
Guests online
2,753
Total visitors
3,284

Forum statistics

Threads
2,308,017
Posts
29,182,621
Members
1,192,737
Latest member
yukitatutz1925
Back
Top