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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 14PE
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,