Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace modem
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- Console.WriteLine ("Welcome to the dowload time estimator");
- Console.WriteLine ("This program with help you calculate how much time it will take you to download a file wiht a 56k modem");
- Console.WriteLine ("Enter file size:");
- string MBstr = Console.ReadLine();
- int MBint=(Int32.Parse(MBstr)*1024);
- double secs = MBint / 5.2;
- //TimeSpan t = TimeSpan.FromSeconds( secs );
- //string timestring = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms", t.Hours, t.Minutes, t.Seconds, t.Milliseconds);
- int minutes=(int)secs/60;
- int hours = minutes / 60;
- minutes = minutes % 60;
- int seconds = (int)secs % 60;
- Console.WriteLine ("MB:"+MBint+": hours"+ hours+" minutes:" +minutes+" seconds:"+seconds);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement