Advertisement
AnitaN

03.OperatorsExpressionsStatements/02.GravitationOnMoon

Mar 20th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. //Problem 2.    Gravitation on the Moon
  2. //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.
  3.  
  4. using System;
  5.  
  6. class GravitationOnMoon
  7. {
  8.     static void Main()
  9.     {
  10.         Console.Write("Please, enter your weight: ");
  11.         double earthWeight = double.Parse(Console.ReadLine());
  12.  
  13.         double moonWeight=earthWeight*0.17;
  14.         Console.WriteLine("Your weight on the Moon is {0}.",moonWeight);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement