What's new

Closed.

Status
Not open for further replies.

Ruyi

𝙳𝚞𝚔𝚎 𝚘𝚏 𝙿𝙷𝙲
Elite
Joined
Dec 7, 2015
Posts
2,132
Solutions
14
Reaction
10,194
Points
1,916
Oks na po salamat
 
Last edited:
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.
Back
Top