Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a C++ program that asks the user for the speed of a vehicle (in mph) and

ID: 3624424 • Letter: I

Question

I need a C++ program that asks the user for the speed of a vehicle (in mph) and how many hours it has traveled. The program should then use a loop to display the distance the vehicle traveled for each hour of that time period.
Example of output:
What is the speed of the vehicle in mph? 40
How many hours has it traveled? 3
Hours Distance traveled
----------------------------------
1 40
2 80
3 120

It cannot accept a negative number for speed or value less than 1 for time traveled.

Thanks for any help.

Explanation / Answer

#include using namespace std; int main() { int speed = -1; int time = 0; while (speed < 0 || time < 1) { cout > speed; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote