/*** Notes:- If you can’t use the IDE (Dev C++, Xcode, etc…) for this question, use the online C++ compiler instead: https://www.onlinegdb.com/online_c++_compiler.While using the IDE or the online C++ compiler, you should NOT open / access any program other than this one, or you’ll get a score of zero (0) for this part. – For this question, upload a .cpp file (source code) only. Any other file type submitted will result a score of zero (0) for this question.*** ***/ Distance traveled: The distance a vehicle travels can be calculated as follow: distance = speed * time For example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should then use a loop to display the total distance traveled at the end of each hour of that period of time. (15 points) Do not hard-code the result values in your program. They must be calculated by using mathematical expressions based on the speed and the number of hours that the user inputs. Sample run 1: (red represents user’s input) What is the speed of the vehicle in mph? 45How many hours has it traveled? 4 Hours Distance traveled====================1 452 903 1354 180 Sample run 2: What is the speed of the vehicle in mph? 33How many hours has it traveled? 3 Hours Distance traveled====================1 332 663 99
Blog
What is the lab format for this class?
What is the lab format for this class?
A project team assigned to develop a new app is focusing on…
A project team assigned to develop a new app is focusing on understanding the project objectives, getting acquainted with one another, and setting preliminary goals. What stage of team development does this describe?
The last day to take the Midterm is 3/16/25. I understand t…
The last day to take the Midterm is 3/16/25. I understand that I have an entire week to schedule and complete this exam. If I wait until the day of the due date, I am putting myself at risk of technical difficulties impeding my completion of this exam. I know that I should take this exam a couple days before the due date to ensure completion of the exam. Please mark this date in your calendar. There are no extensions or retakes for this exam after the due date has passed.
The last day to take the Final Exam is 5/02/25. I understan…
The last day to take the Final Exam is 5/02/25. I understand that I have an entire week to schedule and complete this exam. If I wait until the day of the due date, I am putting myself at risk of technical difficulties impeding my completion of this exam. I know that I should take this exam a couple of days before the due date to ensure completion of the exam. Please mark this date in your calendar. There are no extensions or retakes for this exam.
Write the command to sort a file called file1 in descending…
Write the command to sort a file called file1 in descending order and save the result in the same file name (in one command).
Display all lines that end with the word test in the file ca…
Display all lines that end with the word test in the file called file1.
Display all lines that start with uppercase letters in the f…
Display all lines that start with uppercase letters in the file called file1.
You would like to list only files that have 4 or 5 or 6 in t…
You would like to list only files that have 4 or 5 or 6 in the last character of their names. Write the command.
Write a shell script to ask the user to enter a name and app…
Write a shell script to ask the user to enter a name and append the name to a file called file1. Ask the user to continue or not. If the answer is yes, the same process must repeat.