VickSuna

Untitled

Jun 15th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. int steps = int.Parse(Console.ReadLine());
  2. double lengthOfStep = double.Parse(Console.ReadLine());
  3. int distanceToCover = 100 * int.Parse(Console.ReadLine());
  4.  
  5. double distanceCovered = (steps * 4 / 5 * lengthOfStep) + (steps * 1 / 5 * (lengthOfStep * 0.7));
  6.  
  7. double percentage = (distanceCovered / distanceToCover) * 100;
  8.  
  9. Console.WriteLine($"You travelled {percentage:f2}% of the distance!");
Advertisement
Add Comment
Please, Sign In to add comment