Question: WRITE A C++ PROGRAM ---- Exercise 1: Squared and cubed random numbers Write a C++ program that generates 10 random numbers each falling in the

WRITE A C++ PROGRAM

WRITE A C++ PROGRAM ---- Exercise 1: Squared and cubed random numbers

----

Write a C++ program that generates 10 random numbers each falling in

Exercise 1: Squared and cubed random numbers Write a C++ program that generates 10 random numbers each falling in the range of 0 and 10. These random numbers should be printed in the first column, the square and cube of these numbers should be printed in the second and third columns, respectively, as shown in the sample input/output given. Hint: you can use setw() for formatting. Sample input/output: Random_num Squared 7 49 64 8 64 6 36 4 16 3 9 1 1 81 16 00 00 moto Cubed 343 512 512 216 64 27 1 729 64 0 Exercise 2: Three random arrays Write a C++ program that creates three integer arrays, i.e. A1, A2, and A3, each of size 10. A1 should be filled with random numbers each number in the range of [1, 5); whereas, A2 should also be filled with random numbers but in the range of [5, 10). You should then add the contents of A1 and A2 and store in A3. Finally, you should print the arrays in the format shown in the sample input/output given below. Hint: you can use setw() for formatting. Sample input/output: A1: 3 1 3 7 10 A2: A3: 1 7 8 3 9 1 3 6 8 7 11 1 5 6 6 9 293 9 13 8 9 12

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!