Question: please write in c++ please Goal: This programming assignment Involves rand() function, one dimensional arrays, and functions. Write a program that calculates the distance a

please write in c++ please
 please write in c++ please Goal: This programming assignment Involves rand()

Goal: This programming assignment Involves rand() function, one dimensional arrays, and functions. Write a program that calculates the distance a car travels based on the time (length of travel in hours) and speed(mph in miles) generated randomly with the rand() function. This program should use the parallel arrays in the main function provided and follow the specifications and below. const int SIZE - 5; int main() { int time [SIZE] int speed[SIZE]: int distance(SIZE]: loadArrays (time, speed); calculateDist(time, speed, distance); print (time, speed, distance) : ! : a) Write a function that will generate 5 integers for time array and integers for the speed array. The random numbers for time are ranging (1-6) (reads 1 to 6 inclusively). The random numbers for speed are ranging (50-70] (reads 50 mph to 70 mph inclusively). b) Write a function that will calculate the distance from the values in the time and speed arrays and place the answer in the distance array. The calculation is as the following: distance Value -time Value speed Value c) Write a function that will print out the input data from a) and the calculated items from b) above (print the data (randomly generated to the screen, and the calculated distance values in the format of 3 items on one line.) Instructions: Source code implementations required for submission must include comments (name, date course, assignment, instructor and description of program and meaningful variables.) Use proper prompts and labels for all output. Source code must compile and produce correct code to get full credit. If code does not compile, 0 points will be given. Copy and paste at least 2 sets of test result at the end of the source code Submit source code as paralleArrayLast Name istinitial.epp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!