Answer to Question #199321 in C++ for habiba

Question #199321

Input the grades of a student by taking marks in 3 different subjects using arrays. 2 points

Use functions to Design a grade calculator based on following criteria: 2 points

If the student scores 60 above in all three subjects, then he should get an A grade. 2 points

If the student scores 60 above in only one subject, he gets a B grade. 2 points

If he scores 60 below in all subjects he scores C grade.


1
Expert's answer
2021-05-27T19:09:45-0400
#include<iostream>
using namespace std;
int main()
{
    int a[3],i;
    cout<<"Enter marks in 3 subjects : ";
    for(i=0;i<3;i++)
    {
        cin>>a[i];
    }
    if(a[0]>60 && a[1]>60 && a[2]>60)
    {
        cout<<"You have secured an A grade.";
    }
    else
    {
        if(a[0]>60 || a[1]>60 || a[2]>60)
        {
            cout<<"You have secured a B grade.";
        }
        else
        {
            cout<<"You have secure a C grade.";
        }
    }
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog