Advertisement
pupesko

SoftUni - 5.2 Gravitation on the Moon

Oct 10th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. //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.
  2.  
  3. using System;
  4.  
  5. class GravityMoon
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Write weight of a man on Earth: ");
  10.         string man = Console.ReadLine();
  11.         double weightMan = double.Parse(man);
  12.  
  13.         double wMoon = ((double) (weightMan * 17)) / 100;
  14.         Console.WriteLine(wMoon);
  15.  
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement