Could you add lists or dictionaries to my code to manage the data the user entered!? Also, if you can make the code look better, please change it. Thanks!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Could you add lists or dictionaries to my code to manage the data the user entered!? Also, if you can make the code look better, please change it. Thanks!
E project.py - C:\Users\esfar\Documents\cop2500c\project.py (3.9.9)
Eile Edit Format Run Options Window Help
print ("The knightro grade calcluator")
#All of the functions are used to calculate each part of the total grade
#the gradesum is set to o to help with debugging issue
Ewill create average grade in class
#then will give final average
#then it returns
def finalscore (assignment):
gradesum=0
finalgrade-0
for index in range (assignment):
grade=int (input ("what grade did you get on the final?\n"))
gradesum= gradesum + grade
finalgrade= (finalweight* gradesum) / (100 * assignment)
return (finalscore)
def testscore (assignment) :
gradesum=0
testgrade=0
for index in range (assignment):
grade-int (input ("what grade did you get on the test?\n"))
gradesum= gradesum + grade
quizgrade= (quizweight* gradesum) / (100 * assignment)
return (testscore)
def quizscore (assignment):
gradesum-0
quizgrade=0
for index in range (assignment):
grade-int (input ("what grade did you get on the quiz?\n"))
gradesum= gradesum + grade
quizgrade= (quizweight* gradesum) / (100 * assignment)
return (quizscore)
def homeworkscore (assignment):
gradesum-0
homeworkgrade=0
for index in range (assignment) :
grade-int (input ("what grade did you get on the homework?\n"))
gradesum- gradesum + grade
homeworkarade (homeworkweight* gradesum) / (100 * assignment)
Ln: 8 Col: 0
6:24 AM
* Setti.
O Prog. exa.
proj.
IDLE .
x 035.
x Stats. x Stats. x Stati.
61°F A O D 4)
*exa.
C:\P..
12/4/2021
Transcribed Image Text:E project.py - C:\Users\esfar\Documents\cop2500c\project.py (3.9.9) Eile Edit Format Run Options Window Help print ("The knightro grade calcluator") #All of the functions are used to calculate each part of the total grade #the gradesum is set to o to help with debugging issue Ewill create average grade in class #then will give final average #then it returns def finalscore (assignment): gradesum=0 finalgrade-0 for index in range (assignment): grade=int (input ("what grade did you get on the final?\n")) gradesum= gradesum + grade finalgrade= (finalweight* gradesum) / (100 * assignment) return (finalscore) def testscore (assignment) : gradesum=0 testgrade=0 for index in range (assignment): grade-int (input ("what grade did you get on the test?\n")) gradesum= gradesum + grade quizgrade= (quizweight* gradesum) / (100 * assignment) return (testscore) def quizscore (assignment): gradesum-0 quizgrade=0 for index in range (assignment): grade-int (input ("what grade did you get on the quiz?\n")) gradesum= gradesum + grade quizgrade= (quizweight* gradesum) / (100 * assignment) return (quizscore) def homeworkscore (assignment): gradesum-0 homeworkgrade=0 for index in range (assignment) : grade-int (input ("what grade did you get on the homework?\n")) gradesum- gradesum + grade homeworkarade (homeworkweight* gradesum) / (100 * assignment) Ln: 8 Col: 0 6:24 AM * Setti. O Prog. exa. proj. IDLE . x 035. x Stats. x Stats. x Stati. 61°F A O D 4) *exa. C:\P.. 12/4/2021
quizgrade=0
for index in range (assignment):
grade-int (input ("what grade did you get on the quiz?\n"))
gradesum= gradesum + grade
quizgrade= (quizweight* gradesum) / (100 * assignment)
return (quizscore)
def homeworkscore (assignment):
gradesum=0
homeworkgrade=0
for index in range (assignment) :
grade=int (input ("what grade did you get on the homework?\n"))
gradesum= gradesum + grade
homeworkgrade= (homeworkweight* gradesum) / (100 * assignment)
return (homeworkscore)
#this will put the weight of the assignment as an input
#then the sumweight checks if its accuate
#the user inputs weight for each assignment
#if doesn't add to 100 percent tells user incorrect
sumweight=0
while (sumweight !-100):
homeworkweight=int (input ("enter the weight of homework assignments in percent. \n"))
quizweight=int (input ("enter the weight of quiz assignments in percent. \n"))
testweight=int (input ("enter the weight of test assignments in percent. \n"))
finalweight=int (input ("enter the weight of final assignments in percent. \n"))
sumweight= homeworkweight+quizweight+testweight+finalweight
if (sumweight !=100) :
print ("your class weight is not 100 percent. Retry again.")
#lists how much assignments there are
homeworknum= int (input ("how many homework are there? \n"))
quiznum= int (input ("how many quiz are there? \n"))
testnum= int (input ("how many test are there? \n"))
final-1
totalgrade- homeworkscore (homeworknum) + quizscore (quiznum) + testscore (testnum) + finalscore (final)
print ("your grade in this class is ", totalgrade)
Ln: 8 Col: 0
6:24 AM
出
N
O Setti.
Prog.-
a exa.
E proj.
IDLE ..
*exa.
x
Q3S.
x Stats. x Stats. X Stati.
E CAP.
61°F A OI D 4)
12/4/2021
Transcribed Image Text:quizgrade=0 for index in range (assignment): grade-int (input ("what grade did you get on the quiz?\n")) gradesum= gradesum + grade quizgrade= (quizweight* gradesum) / (100 * assignment) return (quizscore) def homeworkscore (assignment): gradesum=0 homeworkgrade=0 for index in range (assignment) : grade=int (input ("what grade did you get on the homework?\n")) gradesum= gradesum + grade homeworkgrade= (homeworkweight* gradesum) / (100 * assignment) return (homeworkscore) #this will put the weight of the assignment as an input #then the sumweight checks if its accuate #the user inputs weight for each assignment #if doesn't add to 100 percent tells user incorrect sumweight=0 while (sumweight !-100): homeworkweight=int (input ("enter the weight of homework assignments in percent. \n")) quizweight=int (input ("enter the weight of quiz assignments in percent. \n")) testweight=int (input ("enter the weight of test assignments in percent. \n")) finalweight=int (input ("enter the weight of final assignments in percent. \n")) sumweight= homeworkweight+quizweight+testweight+finalweight if (sumweight !=100) : print ("your class weight is not 100 percent. Retry again.") #lists how much assignments there are homeworknum= int (input ("how many homework are there? \n")) quiznum= int (input ("how many quiz are there? \n")) testnum= int (input ("how many test are there? \n")) final-1 totalgrade- homeworkscore (homeworknum) + quizscore (quiznum) + testscore (testnum) + finalscore (final) print ("your grade in this class is ", totalgrade) Ln: 8 Col: 0 6:24 AM 出 N O Setti. Prog.- a exa. E proj. IDLE .. *exa. x Q3S. x Stats. x Stats. X Stati. E CAP. 61°F A OI D 4) 12/4/2021
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY