c++ value returning function - /* Fanny Yang, CMPSC101...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* Fanny Yang, CMPSC101 Prompt the user to enter 3 courses, grades, and number of credits then display the grade and GPA in a function*/ #include<iostream> #include<string> #include<iomanip> using namespace std string lettergrade(double GOA, string letterGrade) void display(double GPA, string letterGrade) int main() { string course1, course2, course3 string letterGrade, letterGrade1, letterGrade2, letterGrade3 int numCredits1, numCredits2, numCredits3 double courseValue1, courseValue2, courseValue3 double GPA cout<<"Enter in the following information. "<<endl<<endl cout<<"Course 1: " cin>>course1 cout<<"How many credits did you earn in "<<course1<<"? " cin>>numCredits1 cout<<"What is the course value you received for "<<course1<<": " cin>>courseValue1 if(courseValue1 >= 4.0) letterGrade1 = "A" else if(courseValue1 >= 3.7) letterGrade1 = "A-" else if(courseValue1 >= 3.5) letterGrade1 = "B+" else if(courseValue1 >= 3.2) letterGrade1 = "B" else if(courseValue1 >= 3.0) letterGrade1 = "B-"
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/18/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Fall '07 term at Pennsylvania State University, University Park.

Page1 / 6

c++ value returning function - /* Fanny Yang, CMPSC101...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online