# include<iostream>
using namespace std;
int main()
{
// Variables are identified.
float ConnectionSpeed=0.0;
float FileSize=00.;
float Conversion=0.0;
double min=0.0;
double hour=0.0;
int choice;
// Opening Statement made here.
cout << " This program will calculate the time it will take" << endl;
cout << " your computer to download the file you want." << endl;
cout << endl;
// Given choice to check true bandwidth.
cout << " Would you like to visit
http://bandwidthplace.com/speedtest/" << endl;
cout << " to find out what your true bandwidth is? (You MUST be online!)" << endl;
cout << endl;
cout << " 1.) No." << endl;
cout << " 2.) Yes." << endl;
cout << endl;
cout << " Please enter the # of your choice: ";
cin >> choice;
if (choice == 1)
{
system ("cls");
}
if (choice == 2)
{
system ("start iexplore bandwidthplace.com/speedtest/");
system ("cls");
cout << endl;
cout << " Please follow the directions from the website to find" << endl;
cout << " out what your true bandwidth is." << endl;
cout << endl;
}
// User enters data here.
cout << " Enter your connection speed in Kb: ";
cin >> ConnectionSpeed;
system ("cls");
cout << " Enter your File size in MB: ";
cin >> FileSize;
system ("cls");
// Calculations made here.
FileSize = FileSize * 1000000;
ConnectionSpeed = ConnectionSpeed * 1000;
ConnectionSpeed = ConnectionSpeed / 8;
Conversion = FileSize / ConnectionSpeed;
min = Conversion / 60;
hour = min / 60;
// Results returned according to the time it will take the user to download his/her file.
for (int x = 1;x<100000000;x++)
{
if (hour == x + 1)
{
cout << " It will take you " << hour << " hours to download that file." << endl;
cout << endl;
}
}
if (hour < 1)
{
cout << " It will take you " << min << " minutes to download that file." << endl;
cout << endl;
}
if (hour > 1)
{
cout << " It will take you " << hour << " hours to download that file." << endl;
cout << endl;
}
if (hour == 1)
{
cout << " It will take you " << hour << " hour to download that file." << endl;
cout << endl;
}
cout << " ***** Built by InfantryGhost *****" << endl;
cout << " ***** Tweaked by jaguar291 *****" << endl;
cout << endl;
// End of program.
return 0;
}