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 return a 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): 5 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)): 7 print('Sorry, you are DISMISSED') 8 else: 9 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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
100%
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 return a 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):
5
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)):
7
print('Sorry, you are DISMISSED')
8
else:
9
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?
Transcribed Image Text: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 return a 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): 5 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)): 7 print('Sorry, you are DISMISSED') 8 else: 9 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?
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,