Answer to Question #47579 in C++ for krad

Question #47579
10. Write a program that accepts an input grade in percentile form and output its grade equivalent: based on the given range of percentile and grade equivalent table below”
Range Grade
98-100 1.00
95-97 1.25
92-94 1.50
89-91 1.75
85-88 2.00
82-84 2.25
80-81 2.50
77-79 2.75
75-76 3.00
60-74 5.00
Other grades “Out of range”
In Switch Case
1
Expert's answer
2014-10-06T02:15:38-0400
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
using namespace std;
int main()
{
float grade = 0.0;
cout<<"Enter the grade in percentile form"<<endl;
cin>>grade;
switch((int)(grade + 0.5))
{
case 60: case 61: case 62: case 63: case 64:
case 65: case 66: case 67: case 68: case 69:
case 70: case 71: case 72: case 73: case 74:
cout<<"Grade 5.00"<<endl; break;
case 75: case 76:
cout<<"Grade 3.00"<<endl; break;
case 77: case 78: case 79:
cout<<"Grade 2.75"<<endl; break;
case 80: case 81:
cout<<"Grade 2.50"<<endl; break;
case 82: case 83:case 84:
cout<<"Grade 2.25"<<endl; break;
case 85: case 86:case 87:case 88:
cout<<"Grade 2.00"<<endl; break;
case 89: case 90: case 91:
cout<<"Grade 1.75"<<endl; break;
case 92: case 93: case 94:
cout<<"Grade 1.50"<<endl; break;
case 95: case 96: case 97:
cout<<"Grade 1.25"<<endl; break;
case 98: case 99: case 100:
cout<<"Grade 1.00"<<endl; break;
default:
cout<<"Out of range"<<endl;
break;
}
system("pause");
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
28.09.17, 08:26

Dear Chad, please submit the new question via panel.

Chad
28.09.17, 07:50

how to do it in C#?

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS