Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please take the work from below and use functions to abstract the code. The goal of this is to make the code more readable and

Please take the work from below and use functions to abstract

the code. The goal of this is to make the code more readable and organized.The new code should run the exact same way as the old code did. If it does, it means the abstraction didnt affect the program, which is the end goal. Code readability and cleanliness are important. Be sure to be smart about using functions and what you abstract and why. A lot of program planning will be useful in doing this successfully. Once you have completed this, I would like you to write approx 1-2 pages where you discuss your technique of abstracting the code. Be sure to discuss your decisions, your process, your struggles, and what you learned overall. Thank you, code below.

#Get the grades homework = float(input("What grade (out of 50) did you receive on the homework? ")) project = float(input("What grade (out of 50) did you receive on the project? ")) quiz = float(input("What grade (out of 40) did you receive on the quizzes? ")) midterm = float(input("What grade (out of 30) did you receive on the midterm? ")) final = float(input("What grade (out of 30) did you receive on the final? ")) #Calculate the total points total = homework + project + quiz + midterm + final max = 200 #Calculate the percentage percent = total / max * 100 #Calculate the grade if percent >= 0 and percent <= 59.99: grade = "F" elif percent >= 60 and percent <= 69.99: grade = "D" elif percent >= 70 and percent <= 79.99: grade = "C" elif percent >= 80 and percent <= 89.99: grade = "B" elif percent >= 90 and percent <= 100: grade = "A" #Print the results print("Your total points: " + str(total)) print("Total possible points: " + str(max)) print("Your Percentage: " + str(percent) + "%") print("Your grade is a " + grade)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

4. What will the team agreement contain?

Answered: 1 week ago

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago

Question

2 What supply is and what affects it.

Answered: 1 week ago