Miles to Kilo table question?
Jul 12, 2011 at 12:22pm UTC
How does this look to everyone? I am displaying 2 rows side by side that lists miles-kilo conversion. This is what I have so far. Anyone have any pointers or see any problems? Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#include <iostream>
#include <iomanip>
using namespace std;
double MakeMilesKmTable ( double , double , int ); //Fuction Prototype
int main ()
{
double start = 1; //Variabledeclaration
double stop = 20;
int increment =1;
cout << "This Program converts from Miles to Kilometers." << endl;
cout << endl;
cout << "Miles \t Kilometers" << setw(10) << "Miles \t Kilometers" << endl;
cout << "---------------------------" << endl;
MakeMilesKmTable (start, stop, increment); //Calling the function
return 0;
}
//Function MakeMilesKmTable
double MakeMilesKmTable ( double start, double stop, int increment)
{
double MileToKilo, split;
split = ( start + stop )/ 2.0;
for (double i=start; i <= split; i++)
{
MileToKilo = i * 1.61;
cout << i << setw(15) << MileToKilo << "\t" << (i - start + split +1 ) << endl;
}
return MileToKilo;
}
Last edited on Jul 12, 2011 at 4:21pm UTC
Jul 12, 2011 at 4:21pm UTC
error message I receive
1>.\Debug\test.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
Topic archived. No new replies allowed.