Thursday, 24 January 2013

Grade Programming

//Program:    This program distribute your Grade with respect to marks.
//Programmer: Muhammad Ateek. Roll#03
//Date:       10/29/2011.

#include <iostream>
#include <limits>

using namespace std;

int main()
{
    cout << "Enter your obtained marks \n";

// Declrations
    int marks;
    cin >> marks;
    cout << "your abtained marks are = ";
    cout << marks << endl;

//Statments
    if(marks<40)                           //If statments.
    {
        cout << "Sorry you have been fail";
    }

    else if (marks>=40,marks<=49)
    {
        cout << "you have been passes and your grade is C";

    }

    else if(marks>=50,marks<=59)
    {
        cout << "You have been passed and you grade is B";
    }

    else if(marks>=60,marks<=69)
    {
        cout << "You have been passed and your grade is B+";
    }

    else if(marks>=70,marks<=79)
    {
        cout << "you have been passed and your grade is A";
    }

    else if (marks>=80,marks<=100)
    {
        cout << "you have been passed and your grade is A+";
    }

else
{
    cout <<"ERROR\n";
    cout << "please enter your obtained marks out of 100";
}
    cin.ignore(numeric_limits<streamsize>::max(), '\n');  // program screen stop.
    cin.get();
    return 0;                                             // Ending
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management