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