adriyanbulgary

OperatorsExpressionsAndStatements - Task 2

Jun 13th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. /*The gravitational field of the Moon is approximately 17%
  3. *of that on the Earth. Write a program that calculates the weight of a man
  4. * on the moon by a given weight on the Earth
  5. */
  6. class MoonGravity
  7. {
  8.     static void Main()
  9.     {
  10.         Console.WriteLine("Please enter your weight in kg");
  11.         float weight = float.Parse(Console.ReadLine());
  12.         float moonWeight = weight * 0.17f;
  13.         Console.WriteLine("Your weight on the Moon will be {0} kg",moonWeight);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment