kuruku

CalculateWeight

Apr 16th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2.  
  3.     //The gravitational field of the Moon is approximately 17% of that on the
  4.     //Earth. Write a program that calculates the weight of a man on the
  5.     //moon by a given weight on the Earth.
  6.  
  7. class CalculateWeight
  8. {
  9.     static void Main()
  10.     {
  11.         Console.Write("Human Weight = ");
  12.         double humanWeight = double.Parse(Console.ReadLine());
  13.  
  14.         Console.WriteLine("Gravitational field = 17 %");
  15.  
  16.         double weightMoon = humanWeight * 0.17;
  17.         Console.Write("weight of a man on the moon = ");
  18.         Console.WriteLine(weightMoon);
  19.     }
  20. }
Add Comment
Please, Sign In to add comment