Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Convert_speed_Units
- {
- class Program
- {
- static void Main()
- {
- double dist = double.Parse(Console.ReadLine());
- double hours = double.Parse(Console.ReadLine());
- double mins = double.Parse(Console.ReadLine());
- double secs = double.Parse(Console.ReadLine());
- float toSeconds = (float)((hours * 60) * 60 + mins * 60 + secs);
- float meterSec = (float)(dist / toSeconds);
- float kms = (float)(dist / 1000);
- float toHours = (float)(hours + (mins / 60) + (secs / 60) / 60);
- float kilomHour = kms / toHours;
- float milesHours = kilomHour / 1.609f;
- Console.WriteLine("{0}", meterSec);
- Console.WriteLine("{0}", kilomHour);
- Console.WriteLine("{0}", milesHours);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement