Many 4-year Universities are on the quarter-credit (rather than semester) system. You are given a student's GPA, total credit count, and honors credit count as input. The total credit count already includes the honors credits. I have already written the run() function. Please declare and define the function getStatus() so that the program works correctly. The graduation status to return is determined by the following rules: Students must have completed at least 180 credits with a GPA of at least 2.0 to graduate. A student who does not meet both of these constraints should receive a return value of "not graduating". Students who do have enough credits to graduate and sufficiently high GPAs will receive one of four return values depending on the GPA and number of honors credits: →All students with GPAs between 2.0 and 3.6 receive a return value of "graduating". → Students with fewer than 15 honors credits receive a return of "cum laude" if their GPA is at least 3.6 but less than 3.8, and a return of "magna cum laude" if their GPA is at least 3.8. → Students with 15 or more honors credits receive a return of "magna cum laude" if their GPA is at least 3.6 but less than 3.8, and a return of "summa cum laude" if their GPA is at least 3.8. Here are some example inputs and their resulting output: For input of 3.87, 178, 16 the output is "not graduating" For input of 1.5, 199, 30 the output is "not graduating" For input of 2.7, 380, 50 the output is "graduating" For input of 3.62, 200, 200 the output is "magna cum laude" For input of 3.93, 185, O the output is "magna cum laude"

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Need help with this c++ code

 

Many 4-year Universities are on the quarter-credit (rather than semester) system. You
are given a student's GPA, total credit count, and honors credit count as input. The total
credit count already includes the honors credits.
I have already written the run() function. Please declare and define the function
getStatus() so that the program works correctly.
The graduation status to return is determined by the following rules:
Students must have completed at least 180 credits with a GPA of at least
2.0 to graduate. A student who does not meet both of these constraints
should receive a return value of "not graduating".
Students who do have enough credits to graduate and sufficiently high
GPAs will receive one of four return values depending on the GPA and
number of honors credits:
→All students with GPAs between 2.0 and 3.6 receive a return value of
"graduating".
→ Students with fewer than 15 honors credits receive a return of "cum
laude" if their GPA is at least 3.6 but less than 3.8, and a return of
"magna cum laude" if their GPA is at least 3.8.
→ Students with 15 or more honors credits receive a return of "magna
cum laude" if their GPA is at least 3.6 but less than 3.8, and a return of
"summa cum laude" if their GPA is at least 3.8.
Here are some example inputs and their resulting output:
For input of 3.87, 178, 16 the output is "not graduating"
For input of 1.5, 199, 30 the output is "not graduating"
For input of 2.7, 380, 50 the output is "graduating"
For input of 3.62, 200, 200 the output is "magna cum laude"
For input of 3.93, 185, O the output is "magna cum laude"
Transcribed Image Text:Many 4-year Universities are on the quarter-credit (rather than semester) system. You are given a student's GPA, total credit count, and honors credit count as input. The total credit count already includes the honors credits. I have already written the run() function. Please declare and define the function getStatus() so that the program works correctly. The graduation status to return is determined by the following rules: Students must have completed at least 180 credits with a GPA of at least 2.0 to graduate. A student who does not meet both of these constraints should receive a return value of "not graduating". Students who do have enough credits to graduate and sufficiently high GPAs will receive one of four return values depending on the GPA and number of honors credits: →All students with GPAs between 2.0 and 3.6 receive a return value of "graduating". → Students with fewer than 15 honors credits receive a return of "cum laude" if their GPA is at least 3.6 but less than 3.8, and a return of "magna cum laude" if their GPA is at least 3.8. → Students with 15 or more honors credits receive a return of "magna cum laude" if their GPA is at least 3.6 but less than 3.8, and a return of "summa cum laude" if their GPA is at least 3.8. Here are some example inputs and their resulting output: For input of 3.87, 178, 16 the output is "not graduating" For input of 1.5, 199, 30 the output is "not graduating" For input of 2.7, 380, 50 the output is "graduating" For input of 3.62, 200, 200 the output is "magna cum laude" For input of 3.93, 185, O the output is "magna cum laude"
14 // Add your function declaration here
# 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
15
16
17 /**
18 * Describe the purpose of your program here.
19 * @return for success.
20
21 int run()
22 {
23
24
25
26
27
*/
28
// DON'T CHANGE ANYTHING IN THIS FUNCTION
cout << STUDENT << "-" << ASSIGNMENT << "-Graduation Calculator" << endl;
cout <<
--" << endl;
cout << "Enter gpa, total credits and honors credits: ";
double gpa;
29
30
31
32
33
34
35
36
37
38
39}
40
41 // Implement your function here
42
int credits, honorsCredits;
cin >> gpa >> credits ›› honorsCredits;
// You will write this function
string result = getStatus (gpa, credits, honorsCredits);
cout << "Result is [\"" << result << "\"]" << endl;
return 0;
Transcribed Image Text:14 // Add your function declaration here # 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 15 16 17 /** 18 * Describe the purpose of your program here. 19 * @return for success. 20 21 int run() 22 { 23 24 25 26 27 */ 28 // DON'T CHANGE ANYTHING IN THIS FUNCTION cout << STUDENT << "-" << ASSIGNMENT << "-Graduation Calculator" << endl; cout << --" << endl; cout << "Enter gpa, total credits and honors credits: "; double gpa; 29 30 31 32 33 34 35 36 37 38 39} 40 41 // Implement your function here 42 int credits, honorsCredits; cin >> gpa >> credits ›› honorsCredits; // You will write this function string result = getStatus (gpa, credits, honorsCredits); cout << "Result is [\"" << result << "\"]" << endl; return 0;
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education