Option 3: Write a program that will input letter grades (A, B, C, D, F), the num
ID: 3767250 • Letter: O
Question
Option 3: Write a program that will input letter grades (A, B, C, D, F), the number of which is input by the user (a maximum of 50 grades). The grades will be read into an array. A function will be called five times once for each letter grade) and will return the total number of grades in that category. The function must be passed 3 parameters: the array, the number of elements in the array, and the letter to be searched for and counted (A, B, C, D or F). The program will print the number of each grade. Sample Run Please input the number of grades to be read in. (1-50): 6 A71 grades must be upper case ABC D or F Input a grade: A Input a grade: C Input a grade: A Input a grade: B Input a grade: B Input a grade: D Number of As 2 Number of Bs - 2 Number of Cs 1 Number of Ds 1 Number of Fs OExplanation / Answer
#include using namespace std; // Function Prototypes. int GetGrades(int,int,int); int FindAverage(int,int); int main()// Determine letter grade of the average. { int numberOfGrades, letterGrade; int totalPoints, average; GetGrades(numberOfGrades,numericGrade,average); // Call GetGrades while (totalPoints >= 0) { if (totalPoints >= 90 && totalPoints ==100) // 90 and above letterGrade = 'A'; else if (totalPoints >= 80 && totalPoints== 100) //80-89 letterGrade = 'B'; else if (totalPoints >= 70 && totalPoints== 79) //70-79 letterGrade = 'C'; else if (totalPoints >= 60 && totalPoints==69) //60-69 letterGrade = 'D'; else if (totalPoints >= 0 && totalPoints== 59) //0-59 letterGrade = 'F'; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.