Question
Write a program which defines in its main function an array of 10 integers, an array of 5 doubles the program then prompts you to
Write a program which defines in its main function an array of 10 integers, an array of 5 doubles the program then prompts you to enter an option which works as follows:
If the option is 1 then the program calls a function template to initialize the array of integers from the keyboard.
If the option is 2 then the program calls the same function above to initialize the array of doubles from the keyboard.
If the option is 3 then the program calls a function template to return and print the average of the values of the array integers
If the option is 4 then the program calls a function template to return and print the average of the values of the array doubles
If the option is 5 then the program calls a function which prompts the user to enter a value then the function searches this value in the array of integers and if it finds it then it returns the index of the value otherwise it return -1.
If the option is 6 then the program calls a function to exit the program
Example: consider the following run
Please enter your option: 1
Please enter 10 integer values: 35 20 45 15 70 25 10 50 90 30
The array has been initialized.
Please enter your option: 3
The average is 3.9
Please enter your option: 5
Please enter your value to search for: 15
Your value found at position 3
Please enter your option: 6
Thank you for using our program
Bye
c++
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