Question: Please write this program visual studio, C + + . Using areays and loops pleaseFor the program assigned below, submit the following: Copy of the

Please write this program visual studio, C++. Using areays and loops pleaseFor the program assigned below, submit the following:
Copy of the source code (.c files) and screenshots of output saved as an electronic attachment to Homework Assignment 9 located in Canvas under Assignments.
Create two arrays of doubles with 5 elements each named miles and kilometers. Prompt the user to enter 5 distance values (in miles) and store each into a corresponding element of miles.
Then, in a second loop convert the values for miles to kilometers and store the result into a corresponding element of the kilometers array. Use the formula below to convert the temperatures from miles to kilometers: (HINT: Don't forget about integer division)
In a third loop, print the two arrays in a table with labels in the first row. Include 2 decimal places for your kilometers output.
Test your program with the following values:
0.5,1.3,3.1,9.3,13.1
2. Create a program that will start with two arrays, each with 20 elements called origArray (datatype int) and newArray(datatype double). Prompt the user to enter values for Max and Min (datatype int) to be used in a random number generator. Using a random number generator seeded with time, assign a random number between Min and Max to each element of origArray. Then determine the average of the values stored into origArray call it origAvg (datatype double). Print origAvg to the screen with 2 decimal places.
Then, in a separate loop populate the elements of newArray with a number depending on the following conditions:
Conditions newarray value should be...
If origArray element origAvg and origArray element is origArray element's value even
If origArray element > origAvg ,Max=80, Min =20 and origArray element is odd 0
If origArray element > origAvg , origArray divided by origAvg
In one final loop, print a table with two columns: origArray and newArray to the console screen. Use origArray and newArray as labels for the top of each column. newArray values should include 3 decimal places.
NOTE: This should be a total of3 separate loops. Test your program with the following values:
Max=80, Min =20
Please write this program visual studio, C + + .

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 Programming Questions!