Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Problem 2. Gravitation on the Moon
- //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.
- using System;
- class GravitationOnMoon
- {
- static void Main()
- {
- Console.Write("Please, enter your weight: ");
- double earthWeight = double.Parse(Console.ReadLine());
- double moonWeight=earthWeight*0.17;
- Console.WriteLine("Your weight on the Moon is {0}.",moonWeight);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement