Saturday 19 July 2014

How to Find Grade in Subject in C++

Structure of the Problem Requirements 

In this Problem we Develop a Code in C++ which inform the User about Grade Against Specific Numbers.
We did it with IF ELSE conditional Logic. At the end, Program asked user that how many time you want yo Calculate Grade with the Help of  Do While Loop .

Source Code

#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;

int main()
{
int marks;
char ch;
cout<<endl<<endl<<"*********** Find Grades ***********"<<endl<<endl;
do{
cout<<"Enter marks : ";   
cin>>marks; // Here Is Enter your Marks
if (marks>=80) // Check if your Marks is Greater or equal than 80 than u got A
{
cout<<"A";
}
else if(marks>=70) // Check if your Marks is Greater or equal than 70 than u got B
{
cout<<"B";
}
else if(marks>=60) // Check if your Marks is Greater or equal than 60 than u got C
{
cout<<"C";
}
else if(marks>=50) // Check if your Marks is Greater or equal than 50 than u got D
{
cout<<"D";
}
else // Check if your Marks is less or equal than 49 than u fail
{
cout<<"Fail";
}
cout<<endl<<endl<<"Do you Want Continue : (Y/N)"<<endl<<endl; // If you want to exist Press N
cin>>ch;
cout<<endl;
}while(ch=='y');
return 0;
}

Output of the Program


Grades in Subjects
Grading your Marks






Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment