Question: write a program that: a) Inputs a positive integer n from the keyboard where n
write a program that:
a) Inputs a positive integer n from the keyboard where n<=50
If n is out of range then print out an error message and asfk or another input. This process repeats until a valud value for n is ontained.
b) Input two 1D arrays of doubles A and B ( of size n) from the keybord.
c) inputs an integer k(1-3) from the keybord
d) if k=1 then it calculares the average value of A[i] and prints it to the screen.
e) if k=2 then it calculated the maximum value of B[i] and prints it to the screen.
f) if k=3 then it reverses the elements of A and prints A to the screen. (DO NOT INTRODUCE ANOTHER AREAY OR USE ANY LIBRARY FUNCTIONS)
For example: if A=[ 2 7 5 25 10] results in A =[10 25 5 7 2]
WRITE IN C++ PLEASE
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
