Advertisement
VyaraG

GravitationOnTheMoon

Nov 28th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.  
  3. //The gravitational field of the Moon is approximately 17% of that on the Earth. Write a program that calculates the weight of a man on the moon by a given weight on the Earth.
  4.  
  5. class GravitationOnTheMoon
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enter your weight on Earth: ");
  10.         double weightOnEarth = double.Parse(Console.ReadLine());
  11.        
  12.         double weightOnMoon = weightOnEarth * 17 / 100;
  13.         Console.Write("Your weight on the Moon is: {0}", weightOnMoon);
  14.         Console.WriteLine();
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement