{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

c++ value returning function

c++ value returning function - Fanny Yang CMPSC101 Prompt...

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 Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

c++ value returning function - Fanny Yang CMPSC101 Prompt...

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

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