Write a C++ program that repeatedly inputs students’ scores an d determines the
ID: 3844785 • Letter: W
Question
Write a C++ program that repeatedly inputs students’ scores an
d determines the letter grades
.
The
scores should be stored in a file called “
scores.txt
”.
For each score, output
the
score along
with
its
letter grade. Your program should
count the number of A’s, B’s, etc.
Use five counters
(
a_count, b_count, etc
)
.
See main program below.
The letter grade is
determined
based on the following scale:
>=
90 (A), >= 80 (B), >= 70(C), >= 60(D), >= 0(F)
.
Output
all
frequencies.
Your program
mu
st
, at least,
include
the following functions:
•
A function
(
get_
grade
)
that
takes a score as a parameter and returns a letter grade.
o
char get_grade(double score);
//prototype
•
A void function to print the score and the grade.
o
void print_grade(double score,
char grade);
•
A void function to print the frequencies.
void print_frequencies(int a_count, int b_count,
int
c_
count, int d_count, intmf_count);
Explanation / Answer
#include #include void main() { clrscr(); int mark[5], i; float sum=0,avg; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.