Please answer item number 3. (pyhthon programming)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question

Please answer item number 3. (pyhthon programming)

Programming Demonstrations
Programming Demo 1: Students' Status Checker
Write a program that will ask a user to input grades in Integral Calculus, Computer
Programming and Physics. A grade of greater than or equal to 70 means PASSED and a
grade of below 70 means FAILED. If the user has a rating of PASSED from all three
subjects, the program must return a status of REGULAR. If the user has only one FAILED
rating, the program must returna status of PROBATIONARY and if the user has two or
more FAILED rating, the program must return a status of DISMISSED. Assume that the
user will only input numerical values for their grades.
1. Type the following code on your Python script.
1 integral_calc = float(input('Input your grade in Integral Calculus: '))
2 phys = float(input('Input your grade in Physics: '))
3 comp_prog = float(input('Input your grade in Computer Programming: '))
4 if (integral_calc>= 70 and phys >= 70 and comp_prog >= 70):
print('Congratulations, you are REGULAR!')
6 elif(integral_calc < 70 and phys < 70) or (integral_calc < 70 and comp prog < 70) or
(comp_prog < 70 and phys < 70)):
print('Sorry, you are DISMISSED')
7
8 else:
print('You are PROBATIONARY!')
2. Run the program and test different input grades for the three subjects. Make sure to
use only acceptable inputs since we didn't put a try/except block to our program.
3. Explain how logical operators are used in lines 4 and 6 to avoid using chained and
nested conditionals.
4. Why does the instance of three FAILED marks (Integral Calculus, Computer
Programming and Physics all less than 70) not included in writing the code for the
program?
A 00 9
Transcribed Image Text:Programming Demonstrations Programming Demo 1: Students' Status Checker Write a program that will ask a user to input grades in Integral Calculus, Computer Programming and Physics. A grade of greater than or equal to 70 means PASSED and a grade of below 70 means FAILED. If the user has a rating of PASSED from all three subjects, the program must return a status of REGULAR. If the user has only one FAILED rating, the program must returna status of PROBATIONARY and if the user has two or more FAILED rating, the program must return a status of DISMISSED. Assume that the user will only input numerical values for their grades. 1. Type the following code on your Python script. 1 integral_calc = float(input('Input your grade in Integral Calculus: ')) 2 phys = float(input('Input your grade in Physics: ')) 3 comp_prog = float(input('Input your grade in Computer Programming: ')) 4 if (integral_calc>= 70 and phys >= 70 and comp_prog >= 70): print('Congratulations, you are REGULAR!') 6 elif(integral_calc < 70 and phys < 70) or (integral_calc < 70 and comp prog < 70) or (comp_prog < 70 and phys < 70)): print('Sorry, you are DISMISSED') 7 8 else: print('You are PROBATIONARY!') 2. Run the program and test different input grades for the three subjects. Make sure to use only acceptable inputs since we didn't put a try/except block to our program. 3. Explain how logical operators are used in lines 4 and 6 to avoid using chained and nested conditionals. 4. Why does the instance of three FAILED marks (Integral Calculus, Computer Programming and Physics all less than 70) not included in writing the code for the program? A 00 9
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Keywords
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning