Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int steps = int.Parse(Console.ReadLine());
- double lengthOfStep = double.Parse(Console.ReadLine());
- int distanceToCover = 100 * int.Parse(Console.ReadLine());
- double distanceCovered = (steps * 4 / 5 * lengthOfStep) + (steps * 1 / 5 * (lengthOfStep * 0.7));
- double percentage = (distanceCovered / distanceToCover) * 100;
- Console.WriteLine($"You travelled {percentage:f2}% of the distance!");
Advertisement
Add Comment
Please, Sign In to add comment