Question
Lab #1 Grade Median Write a C++ program that asks the user how many grades there are, inputs the grades, and displays the median of
Lab #1 Grade Median Write a C++ program that asks the user how many grades there are, inputs the grades, and displays the median of those grades. The median grades is the middle grade. If there are an even number of grades, the median is the average of the middle two grades. Examples Grades Median 76.5 82.3 69.8 89.0 78.2 78.2 76.5 82.3 69.8 89.0 78.2 63.1 77.35 Your program must: 1. Store the grades in an array. 2. Have a function that inputs the grades, stores them in an array and returns the number of grades. 3. Handle up to 20 grades 4. Use a function that sorts an array of grades. 5. Have a separate function that takes a sorted array and the number of grades. It returns the median of those grades. Hints: Chapter 3 contains examples of C++ console input and output Chapter 7 has examples using arrays, and passing arrays as function arguments. Chapter 8 provides some sort algorithms. Once your program executes correctly, upload your .cpp file. Make sure your name is in the program in a comment. Sample Output (Bold indicates user input) Please enter the number of grades: 6 85.2 92.3 78.0 51.5 91.6 87.0 The median grade is 86.1
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