Question

Summary In this lab, you use the pseudocode in figure below to add code to a...

Summary

In this lab, you use the pseudocode in figure below to add code to a partially created Python program. When completed, college admissions officers should be able to use the Python program to determine whether to accept or reject a student, based on his or her class rank.

start
   input testScore, classRank
   if testScore >= 90 then
      if classRank >= 25 then
         output "Accept"
      else
         output "Reject"
      endif
   else
      if testScore >= 80 then
         if classRank >= 50 then
            output "Accept"
         else
            output "Reject"
         endif
      else
         if testScore >= 70 then
            if classRank >= 75 then
               output "Accept"
            else
               output "Reject"
            endif
         else
            output "Reject"
         endif
      endif
   endif
stop

Instructions

  1. Study the pseudocode in picture above.
  2. Write the interactive input statements to retrieve:
    • A student’s test score (testScoreString)
    • A student's class rank (classRankString)
  3. Write the statements to convert the string representation of a student’s test score and class rank to the integer data type (testScore and classRank, respectively).
  4. The rest of the program is written for you.

Homework Answers

Answer #1

CODE:

# input statements
# we are also converting string inputs to integer here
testScore = int(input("Enter student's test score: "))
classRank = int(input("Enter student's class rank: "))

# conditional statements
if testScore >= 90:
   if classRank >= 25:
      print("Accept")
   else:
      print("Reject")
else:
   if testScore >= 80:
      if classRank >= 50:
         print("Accept")
      else:
         print("Reject")
   else:
      if testScore >= 70:
         if classRank >= 75:
            print("Accept")
         else:
            print("Reject")
      else:
         print("Reject")

OUTPUT:

FOR HELP PLEASE COMMENT.
THANK YOU

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features...
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features the design of a calculator program using pseudocode and a Python program that uses a list and functions with variable scope to add, subtract, multiply, and divide. Open the M4Lab1ii.py program in IDLE and save it as M4Lab1ii.py with your initials instead of ii. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and...
n this lab, you use what you have learned about parallel arrays to complete a partially...
n this lab, you use what you have learned about parallel arrays to complete a partially completed C++ program. The program should: Either print the name and price for a coffee add-in from the Jumpin’ Jive Coffee Shop Or it should print the message Sorry, we do not carry that. Read the problem description carefully before you begin. The file provided for this lab includes the necessary variable declarations and input statements. You need to write the part of the...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using the following guidelines - Write two primary helper functions - one iterative (IsArrayPrimeIter) and one recursive (IsArrayPrimeRecur) - each of which Take the array and its size as input params and return a bool. Print out a message "Entering <function_name>" as the first statement of each function. Perform the code to test whether every element of the array is a Prime number. Print out...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input operator>> a bigint in the following manner: Read in any number of digits [0-9] until a semi colon ";" is encountered. The number may span over multiple lines. You can assume the input is valid. Overload the operator+ so that it adds two bigint together. Overload the subscript operator[]. It should return the i-th digit, where i is the 10^i position. So the first...