0% found this document useful (0 votes)
1 views1 page

Grade Program

The C++ program prompts the user to enter a score and assigns a grade based on predefined score ranges. A score of 79.5 or higher results in a grade of 4, while lower scores correspond to grades 3, 2, 1, or 0. The program uses conditional statements to determine the appropriate grade based on the input score.

Uploaded by

31445.phisit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views1 page

Grade Program

The C++ program prompts the user to enter a score and assigns a grade based on predefined score ranges. A score of 79.5 or higher results in a grade of 4, while lower scores correspond to grades 3, 2, 1, or 0. The program uses conditional statements to determine the appropriate grade based on the input score.

Uploaded by

31445.phisit
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

C++ Grade Program

#include <iostream>
using namespace std;

int main() {
float score;

cout << "Enter Score : ";


cin >> score;

if (score >= 79.5)


cout << "Grade is : 4";
else if (score >= 69.5)
cout << "Grade is : 3";
else if (score >= 59.5)
cout << "Grade is : 2";
else if (score >= 49.5)
cout << "Grade is : 1";
else
cout << "Grade is : 0";

return 0;
}

You might also like