Function: This program determines if a student will be admitted or rejected.     Input:  Interactive    Output: Accept or Reject */   #include  using namespace std; int main() {     // Declare variables              // Prompt for and get user input             // Test using admission requirements and print Accept or Reject     if(testScore >= 90)    {       if(classRank >= 25)       {          cout << "Accept" << endl;       }       else    cout << "Reject" << endl;     }    else     {       if(testScore >= 80)       {          if(classRank >= 50)       cout << "Accept" << endl;    else       cout << "Reject" << endl;       }       else       {          if(testScore >= 70)    {             if(classRank >=75)                 cout << "Accept" << endl;             else                cout << "Reject" << endl;    }    else             cout << "Reject" << endl;       }    } }  //End of main() function

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
   Function: This program determines if a student will be admitted or rejected. 
   Input:  Interactive
   Output: Accept or Reject
*/  

#include <iostream>
using namespace std;
int main()
   // Declare variables
   
     
   // Prompt for and get user input 
   
   
   // Test using admission requirements and print Accept or Reject 
   if(testScore >= 90)
   {
      if(classRank >= 25)
      {
         cout << "Accept" << endl;
      }
      else
   cout << "Reject" << endl; 
   }
   else 
   {
      if(testScore >= 80)
      {
         if(classRank >= 50)
      cout << "Accept" << endl;
   else
      cout << "Reject" << endl;
      }
      else
      {
         if(testScore >= 70)
   {
            if(classRank >=75) 
               cout << "Accept" << endl;
            else
               cout << "Reject" << endl;
   }
   else
            cout << "Reject" << endl;
      }
   }

}  //End of main() function
gage.comtaIcn
CENGAGE MINDTAP
Using Flowcharts and Pseudocode to Write a C++ Program
Using Flowcharts and Pseudocode
CollegeA
1/* Pr
to Write a C++ Program
2.
Fur
3.
Inp
Summary
4.
Out
5 */
</>
96.
In this lab, you use the flowchart and pseudocode
found in the figures below to add code to a partially
7 #inclu
8 using
created C++ program. When completed, college
9 int ma
admissions officers should be able to use the C++
10 f
program to determine whether to accept or reject a
11
//
student, based on his or her test score and class
12
13
rank.
14
// F
15
16
start
17
18
if(t
Declarations
num originalNumber
num calculatedAnswer
19
20
21
input
originalNumber
22
This is the priming
input.
23
24
el
Yes
25
cout
not eof?
26
27
else
No
calculatedAnswer =
28
stop
originalNumber 2
29
if
30
output
calculatedAnswer
32
COL
33
else
This step gets all
subsequent inputs.
in Open image in a new tab
origina INumber
34
Cou
35
36
els
37
38
start
39
input testScore, classRank
40
if testScore >= 90 then
41
if classRank >= 25 then
codevolve-assets/cengage/PLD-9th/PLD9_C++_Chp3_Flowchart.png
m.
Transcribed Image Text:gage.comtaIcn CENGAGE MINDTAP Using Flowcharts and Pseudocode to Write a C++ Program Using Flowcharts and Pseudocode CollegeA 1/* Pr to Write a C++ Program 2. Fur 3. Inp Summary 4. Out 5 */ </> 96. In this lab, you use the flowchart and pseudocode found in the figures below to add code to a partially 7 #inclu 8 using created C++ program. When completed, college 9 int ma admissions officers should be able to use the C++ 10 f program to determine whether to accept or reject a 11 // student, based on his or her test score and class 12 13 rank. 14 // F 15 16 start 17 18 if(t Declarations num originalNumber num calculatedAnswer 19 20 21 input originalNumber 22 This is the priming input. 23 24 el Yes 25 cout not eof? 26 27 else No calculatedAnswer = 28 stop originalNumber 2 29 if 30 output calculatedAnswer 32 COL 33 else This step gets all subsequent inputs. in Open image in a new tab origina INumber 34 Cou 35 36 els 37 38 start 39 input testScore, classRank 40 if testScore >= 90 then 41 if classRank >= 25 then codevolve-assets/cengage/PLD-9th/PLD9_C++_Chp3_Flowchart.png m.
ge Learning
9how to apply text shadow in
O(342) YouTube
ps://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=97813372746098id=D1075460596
く
CENGAGE MINDTAP
Using Flowcharts and Pseudocode to Write a C++ Program
Using Flowcharts and Pseudocode
Col
to Write a C++ Program
udy Tools
2
else
3.
if testScore >= 70 then
4)
if classRank = 75 then
5*
output "Accept"
7 #1
s Tips
else
8 us
output "Reject"
9 in
s Tips
endif
10 {
else
11
YOU
output "Reject"
12
endif
endif
14
endif
15
stop
16
c of an
17
18
19
Instructions
20
21
1. Study the pseudocode in picture above.
22
2. Write the interactive input statements to retrieve:
23
o A student's test score ( testScore)
25
26
el
| 28
o A student's class rank (classRank )
27
3. The rest of the program is written for you.
29
4. Execute the program by clicking the Run button.
Enter 87 for the test score and 60 for the class
31
32
rank.
33
els
5. Execute the program by entering 60 for the test
34
35
score and 87 for the class rank.
36
37
[comment]: > (3. Write the statements to convert
38
the string representation of a student's test score and
39
class rank to the integer data type ( testScore and
40
41
classRank, respectively).)
421
43
耳
4
!!
目
Transcribed Image Text:ge Learning 9how to apply text shadow in O(342) YouTube ps://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=97813372746098id=D1075460596 く CENGAGE MINDTAP Using Flowcharts and Pseudocode to Write a C++ Program Using Flowcharts and Pseudocode Col to Write a C++ Program udy Tools 2 else 3. if testScore >= 70 then 4) if classRank = 75 then 5* output "Accept" 7 #1 s Tips else 8 us output "Reject" 9 in s Tips endif 10 { else 11 YOU output "Reject" 12 endif endif 14 endif 15 stop 16 c of an 17 18 19 Instructions 20 21 1. Study the pseudocode in picture above. 22 2. Write the interactive input statements to retrieve: 23 o A student's test score ( testScore) 25 26 el | 28 o A student's class rank (classRank ) 27 3. The rest of the program is written for you. 29 4. Execute the program by clicking the Run button. Enter 87 for the test score and 60 for the class 31 32 rank. 33 els 5. Execute the program by entering 60 for the test 34 35 score and 87 for the class rank. 36 37 [comment]: > (3. Write the statements to convert 38 the string representation of a student's test score and 39 class rank to the integer data type ( testScore and 40 41 classRank, respectively).) 421 43 耳 4 !! 目
Expert Solution
Step 1

Required:

Function: This program determines if a student will be admitted or rejected. 

   Input:  Interactive
   Output: Accept or Reject
 
 
 
Required code with comments for explanation and screenshot of both code and output has been provided in the next step.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Types of Function
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