64 637
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #15909 in C++ for buckly brian

Question #15909
Your Mathematic school teacher want to use a program that can read the name and the mark of a student. Your teacher want the program to automatically find the grade of the mark and display the result(name, mark and grade). Help your teacher to develop a program that can solve his problem.

The grading is as follow
80 – 100 A
60 – 79 B
40 – 59 C
0 – 39 D
Expert's answer
#include<iostream.h>

char name[50], grade;
int mark;

void main(){
cout<<"Enter the name of a student: ";
cin>>name;
cout<<"Enter the mark of a student: ";
cin>>mark;
grade = 'A';
if (mark<80) grade = 'B';
if (mark<60) grade = 'C';
if (mark<40) grade = 'D';
cout<<"Student: "<<name<<"\nMark: "<<mark<<"\nGrade: "<<grade<<"\n";
}

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

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions