Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am having an issue finishing out this last function. I have other functions within my application. I select number 1, for one function, number

I am having an issue finishing out this last function. I have other functions within my application. I select number 1, for one function, number 2 for another one but I am having issues ending the last one here and was hoping someone could provide some guidance.

def main(): """ """

def compute__gpa(grades): if (grades== "A"): return 16.0; elif (grades== "B"): return 12.0; elif (grades== "C"): return 8.0; elif (grades== "D"): return 4.0; else: return 0.0; def run(): Math = str(input("Enter your Math letter grade: ")) courseCredit = float(4) print(f"Grade point for course 1 is {compute__gpa(Math)}.") English = str(input("Enter your English letter grade: ")) courseCredit2 = float(4) print(f"Grade point for course 2 is {compute__gpa(English)}.") Science = str(input("Enter your Science letter grade: ")) courseCredit3 = float(4) print(f"Grade point for course 3 is {compute__gpa(Science)}.")

GPA = ((compute__gpa(Math) * courseCredit) + (compute__gpa(English) * courseCredit2) + (compute__gpa(Science) * courseCredit3)) / (courseCredit + courseCredit2 + courseCredit3)/4

print(f"Your GPA is: {str(GPA)}")

#if __name__ == "__main__": #run()

try: main() except SystemExit: print("Exiting...")

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

More Books

Students also viewed these Databases questions

Question

What is computer neworking ?

Answered: 1 week ago

Question

4. What advice would you give to Carol Sullivan-Diaz?

Answered: 1 week ago