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
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT