Question: c + + , writing a program that stores a list of scores and the corresponding letter grades in two parallel arrays. The scores will
cwriting a program that stores a list of scores and the corresponding letter grades in two parallel arrays. The scores will be double data type and the letter grade will be a char data type.
Welcome to my Parallel Arrays program!
Please enter the list of scores to end input:
Valid scores are between and inclusive.
Your stats are as below:
The list of scores and their grades are:
A
C
B
C
B
D
A
A
The list sorted by scores in ascending order:
D
C
C
B
B
A
A
A
The median score is
Thank you for using my Parallel Arrays program!!
Welcome to my Parallel Arrays program!
Please enter the list of scores to end input:
Valid scores are between and inclusive.
Invalid score! Please try again!!
abc
Invalid score! Please try again!!
Your stats are as below:
The list of scores and their grades are:
A
C
B
B
D
A
A
A
The list sorted by scores in ascending order:
D
C
B
B
A
A
A
A
The median score is
Thank you for using my Parallel Arrays program!!
program requirement thanks for your help
first read the numerical scores from the user as input into a double array, and then calculate the letter grade and fill another parallel array and print the two arrays as output.
The numerical score must be between and inclusive. The user should not be allowed to enter a score less than or greater than
You will also sort the arrays based on the scores, and calculate the median of the scores and output the sorted arrays and the median in main
Write the following functions and call them in the same order as instructed in the main function to accomplish this Task.
void welcome This function prints a welcome message to the user.
void readScoresdouble scores int &count
Reads a list of scores from the user. A indicates the end of the input and is not stored in the array. Use an appropriate loop!! Check out this example code a for loop is count controlled, and a while loop is condition based.
Call the readDouble function to do this. You must catch all invalid data such as characters, negative numbers other than etc.
The variable count keeps track of the number of scores entered.
You must also do validation to make sure that the number is between and inclusive and nothing other than that. Use a while loop to do this.
void readDoublestring prompt, double &num
This function should be used any time you read any floats or doubles from the user. Use this function to read the numerical scores from the user.
It takes a string prompt, outputs it reads a number from the user, validates and returns the num by reference.
Write it exactly like the readInt from assignment but declare a double or float instead of an int. See Sampleacpp for the readInt function.
You must catch all invalid data such as characters, negative numbers etc.
void calcGradedouble scores char grade int count
Use a loop to process each array element and calculate the letter grade for each score.
Letter Grade
Score
Level
A
Exceeds
B
Meets
C
Approaching
D
Not Yet
F
No Evidence
void printListdouble scores char grades int count
Go through a for loop and print the scores and the corresponding grades for each item.
void sortdouble scores char grade int count
Sort the arrays using the given sorting algorithm.
double mediandouble scores int countnew to this level
After sorting, write this function to identify the median score. The median is located in the middle of the array if the arrays size is odd. Otherwise, the median is the average of the middle two values.
Return the median to main and output in main with two decimal places.
int main
Declare all variables needed. The arrays double scores and char grades must be declared in main
Call readScores and send scores and count to it This will fill the scores array from the user. You should call the readDouble function to read and validate the scores before adding them to the scores array.
count will have the number of values read.
Call calcGradefunction that takes the scores array and an empty grades array and fills the grades array with letter grades.
Call the printList function to print the lists.
Call the sort function to sort the list based on scores.
Call the printList function to print the lists.
Call the median function to find the median and print it in main
Assume the arrays will always contain fewer than values. You must not let the user enter more than values.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
