Write a program that generates an array of 10 elements filled up with random int
ID: 3621201 • Letter: W
Question
Write a program that generates an array of 10 elements filled up with random integer number ranging from 50 to 150, and display on the screen.
After the creation and displaying of the array, the program displays the following:
[A]verage [E]ven [M]inimum [Q]uit
please select an option:_
Then, if the user selects:
A (lowercase or uppercase): the program displays the mean value of the numbers contained in the array (2 decimal digits maximum).
E (lowercase or uppercase): The program displays only the even numbers (not indexes) of the array.
M (lowercase or uppercase): the program displays the minimum present in the array.
Q (lowercase or uppercase): the program exits.
I'm new to Arrays, and need help in figuring out the code for this type of program
Please help,
thank you.
Explanation / Answer
#include #include #include using namespace std; int main() { int arr[10]; int i; char input; for (i = 0; i < 10; i++) { int x = rand()%(150 - 50) + 50; arr[i] = x; } do { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.