Question
Write a program that creates an int array of 9. The program should get input from the user to determine actions to perform. Print the
Write a program that creates an int array of 9. The program should get input from the user to determine actions to perform. Print the options each time. User input should be an int and corresponds to the following actions:
0 Quit program
1 Print sum of array
2 Print last element of array
3 Print the number of occurrences of even numbers
4 Swap the first and last element of the array and print the new array
Sample execution using array: 5,7,9,10,12,2,50,2,43 Input will be italicized. Output will be bold.
Select an option.
0 Quit program
1 Print sum of array
2 Print last element of array
3 Print the number of occurrences of even numbers
4 Swap the first and last element of the array and print the new array
1 140 2 43 4 43 7 9 10 12 2 50 2 5 2 5 3 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started