9. Do Programming Exercise 3 from Chapter 5 using a function grade(score) that returns the letter grade for a score.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.1: Assignment Operations
Problem 3E: (Conversion) Write an assignment statement to convert temperature in degrees Fahrenheit to degrees...
icon
Related questions
Question
Python question
9. Do Programming Exercise 3 from Chapter 5 using a function grade (score)
that returns the letter grade for a score.
10
Transcribed Image Text:9. Do Programming Exercise 3 from Chapter 5 using a function grade (score) that returns the letter grade for a score. 10
Ans:
Code:
score = int(input("Enter the exam score:"))
if score > 90 and score < 100:
print("Grade is A")
if score > 80 and score < 89:
print("Grade is B")
if score > 70 and score < 79:
print("Grade is C")
if score > 60 and score < 60:
print("Grade is D")
if score < 60:
print("Grade is F")
Step2
b)
Output:
Enter the exam score:76
Grade is C
Transcribed Image Text:Ans: Code: score = int(input("Enter the exam score:")) if score > 90 and score < 100: print("Grade is A") if score > 80 and score < 89: print("Grade is B") if score > 70 and score < 79: print("Grade is C") if score > 60 and score < 60: print("Grade is D") if score < 60: print("Grade is F") Step2 b) Output: Enter the exam score:76 Grade is C
Expert Solution
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT