Write a C++ program to convert velocities to alternate units as described below:
ID: 3869288 • Letter: W
Question
Explanation / Answer
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
int vel[21][3];
for (int i = 0; i<21; i++){
vel[i][0] = i*5;
vel[i][1] = vel[i][0] * 1.60934;
vel[i][2] = vel[i][0] * 1.46667;
}
cout << setw(10) << "Mph" << setw(15) << "Kmph" << setw(15) << "ftps" << endl;
for (int i = 0; i<21; i++){
cout << setw(10) << vel[i][0] << setw(15) << vel[i][1] << setw(15) << vel[i][2] << endl;
}
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.