I need help in my c++ program HW (c++ codes please) Design and code a program wh
ID: 3679144 • Letter: I
Question
I need help in my c++ program HW (c++ codes please)
Design and code a program which outputs a numeric grade and a letter grade. The numeric grade is a score 0-100. The letter is based on the numeric grade according to the following scale: Your program will read a test score (this can be any integer value) and the max number of points for the test(agaia any integer value). It must then convert the test grade to a value 0-100 and determine the letter grade corresponding to that value. Your program should repeat the process for 12 test grades and test points if test score is 35 and max test points are 45, the numeric score (based on 100) is 77.77 and the letter grade is C if test score is 22 and max test points are 25, the numeric score (based on 100 is 88 and the letter grade is B if test score is 100 and max test points are 200, the numeric score (based on 100 is 50 and the letter grade is FExplanation / Answer
Code to find out the grade depending upon the marks got out of total marks w .r .t 100
#include <iostream>
using namespace std; int main()
{
int score,max;
double outofhun;char c;
while (true){
cout << " What is your Test Score : ";
cin >> score;
cout << "The Max number of points for the test :";
cin >> max;
outofhun=((double)score/(double)max)*100;
if(outofhun>=90 && outofhun<=100)
{
cout << "The numeric score(based on 100) is " << outofhun << " The letter Grade is 'A' ";
}else if(outofhun>=80 && outofhun<=89)
{
cout << "The numeric score(based on 100) is " << outofhun << " The letter Grade is 'B' ";
}else if(outofhun>=70 && outofhun<=79)
{
cout << "The numeric score(based on 100) is " << outofhun << " The letter Grade is 'C' ";
}else if(outofhun>=60 && outofhun<=69)
{
cout << "The numeric score(based on 100) is " << outofhun << " The letter Grade is 'D' ";
}else if(outofhun<60)
{
cout << "The numeric score(based on 100) is " << outofhun << " The letter Grade is 'F' ";
}
cout << "Do You want to continue(Y/N):";
cin >> c;
if(c=='Y' || c=='y')
{
continue;
}
else
{
break;
}
}
return 0;
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
output:
What is your Test Score :23
The Max number of points for the test :25
The numeric score(based on 100) is 92.0 The letter Grade is 'A'
Do You want to continue(Y/N):y
What is your Test Score :23
The Max number of points for the test :50
The numeric score(based on 100) is 46.0 The letter Grade is 'F'
Do You want to continue(Y/N):
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.