Part A Tuition (Computing future tuition) Suppose that the tuition for the unive
ID: 3621190 • Letter: P
Question
Part ATuition
(Computing future tuition) Suppose that the tuition for the university is $10,000 this year and increases 5% every year. Write a program that uses a loop to compute the tuition in ten years.
Part B
(Conversion from miles to kilometers) Write a program that displays the following table (note that 1 mile is 1.609 kilometers):
Miles Kilometers
1 1.609
2 3.218
...
9 14.481
10 16.09
Part C
(Conversion from miles to kilometers) Write a program that displays the following two tables side-by-side (note that 1 mile is 1.609 kilometers):
Miles Kilometers Kilometers Miles
1 1.609 20 12.430
2 3.218 25 15.538
...
9 14.481 60 37.290
10 16.09 65 40.398
Explanation / Answer
please rate - thanks
cramster rule is 1 question per post, but these are easy
#include <iostream>
using namespace std;
int main()
{int i;
double t=10000;
for(i=0;i<10;i++)
t=t+.05*t;
cout<<"tuition in 10 years= $"<<t<<endl;
system("pause");
return 0;
}
---------------
#include <iostream>
using namespace std;
int main()
{int i;
cout<<"Miles kilometers ";
for(i=1;i<=10;i++)
cout<<i<<" "<<i*1.609<<endl;
system("pause");
return 0;
}
---------------------------------------
#include <iostream>
using namespace std;
int main()
{int i,j=20;
cout<<"Miles kilometers kilometers miles ";
for(i=1;i<=10;i++)
{cout<<i<<" "<<i*1.609<<" "<<j<<" "<<j/1.609<<endl;
j+=5;
}
system("pause");
return 0;
}