All pastes #2113506 Raw Edit

Untitled

public text v1 · immutable
#2113506 ·published 2012-02-08 23:50 UTC
rendered paste body
/*
 
 Name: Zach Hoggard
 Student No.: 250 611 551
 Email: zhoggard@uwo.ca
 Section: 004
 Date: February 8, 2012
 
 */


#include <iostream>
#include <cmath>

using namespace std;

int main ()

{
    //Declare the program purpose
    cout << "This program finds the letter grade of a given mark.\n";
    
    //Declare variables
    double grade;
    
    //Ask user to input a grade
    cout << "Please enter a grade: ";
    cin >> grade;
    cout << grade << "\n";
    
    //Decide the grade letter
    if (grade >= 90)
        cout << "The stduent's grade is A+\n";
    if (grade < 90 && grade >= 80)
        cout << "The student's grade is A\n";
    if (grade < 80 && grade >= 70)
        cout << "The student's grade is B\n";
    if (grade < 70 && grade >= 60) 
        cout << "The student's grade is C\n";
    if (grade < 60 && grade >= 50) 
        cout << "The student's grade is D\n";
    if (grade < 50)
        cout << "The student's grade is F\n";
    
    //Terminate program
    return 0;
    
}