Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Python programming only 

FIX THE ERRORS IN THE CODE EXERCISE

Here is a program on calculating grades. Please correct the errors in the program.
# Calculating Grades (ok, let me think about this one)
# Write a program that will average 3 numeric exam grades, return an average test score, a corresponding letter grade, and a message stating whether the student is passing.

please use the code below just need any errors in it corrected like profreading an essay im having trouble with it 

grades = [exam_one exam_two exam_three]
sum = 0
for grade in grade:
sum sum + grade
avg=sum / len (grdes)
if avg >= 90:
letter_grade = "A"
elif avg >= 80 and avg < 90
letter_grade = "B"
elif avg> 69 and avg < 80:
letter_grade = "C'
elif avg <= 69 and avg >= 65:
letter_grade = "D"
elif:
letter_grade = "F"
for grade in grades:
print("Exam: " + str(grade))
print("Average:
+ str(avg))
print("Grade: " + letter_grade)
if letter-grade is "F":
11
print "Student is failing."
print "Student is passing."
else:
Fixed:
expand button
Transcribed Image Text:grades = [exam_one exam_two exam_three] sum = 0 for grade in grade: sum sum + grade avg=sum / len (grdes) if avg >= 90: letter_grade = "A" elif avg >= 80 and avg < 90 letter_grade = "B" elif avg> 69 and avg < 80: letter_grade = "C' elif avg <= 69 and avg >= 65: letter_grade = "D" elif: letter_grade = "F" for grade in grades: print("Exam: " + str(grade)) print("Average: + str(avg)) print("Grade: " + letter_grade) if letter-grade is "F": 11 print "Student is failing." print "Student is passing." else: Fixed:
Here is a program on calculating grades. Please correct the errors in the program.
# Calculating Grades (ok, Let me think about this one)
# Write a program that will average 3 numeric exam grades, return an av
erage test score, a corresponding Letter grade, and a message stating w
hether the student is passing.
# Average
# 90+ A
#
# 70-79
# 60-69
# 0-59
Grade
B
с
# Exams: 89, 90, 90
# Average: 90
# Grade: A
# Student is passing.
exam_3 =
D
F
# Exams: 50, 51, 0
# Average: 33
# Grade: F
# Student is failing.
=
exam_one = int(input("Input exam grade one: "))
exam_two input ("Input exam grade two: "))
str(input("Input exam grade three: "))
expand button
Transcribed Image Text:Here is a program on calculating grades. Please correct the errors in the program. # Calculating Grades (ok, Let me think about this one) # Write a program that will average 3 numeric exam grades, return an av erage test score, a corresponding Letter grade, and a message stating w hether the student is passing. # Average # 90+ A # # 70-79 # 60-69 # 0-59 Grade B с # Exams: 89, 90, 90 # Average: 90 # Grade: A # Student is passing. exam_3 = D F # Exams: 50, 51, 0 # Average: 33 # Grade: F # Student is failing. = exam_one = int(input("Input exam grade one: ")) exam_two input ("Input exam grade two: ")) str(input("Input exam grade three: "))
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education