Question
C++ programming Part 1: a) Create an int array to store 10 values. Write a simple loop to initialize the array elements with the values
C++ programming
Part 1: a) Create an int array to store 10 values. Write a simple loop to initialize the array elements with the values 2, 4, ... 20 Write another loop to print all the elements of the array in reverse. b) Create a char array to store 26 values. Write a simple loop to initialize the array elements with the values a, b, c ... z Write another loop to print all the vowels and the index where each is stored. e.g.: a at index 0 c) Implement a function named avg that takes an int array and its length as parameters and returns the average of the values in the array. Call the function with a sample array and print the average value. d) Implement a function named min_max that takes an int array, its length, and two int parameters min and max. The function sets min to the min value in the array and max to the max value in the array. The function returns nothing. Call the function and print the min and max values found.
e) Implement a function named getScores that takes an int array, its length, and an int parameter scores_entered. The function repeatedly asks the user to enter scores until the user enters -1 or the array capacity has been reached. The function stores the scores entered in the array and sets the scores_entered parameter to the number of scores entered by the user. The function returns nothing. f) Implement a function named scoreStatistics that gets up to 100 scores from the user and prints the min, the max and the average score. The function takes no parameters and returns nothing. It does all its work by relying on the functions in 3, 4, and 5 implemented above.
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