Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Simple Error Handling It is likely that as you were interacting with the GPACalculator program you encountered some runtime errors depending on the input values
Simple Error Handling It is likely that as you were interacting with the GPACalculator program you encountered some runtime errors depending on the input values you tried to enter. Taking a closer look at our program we would notice that we do not have any form of error checking and handling in our code. The closest thing we have is the if statements in the getLetterGradeValue that return -1 when an entered letter does not match any of our letter grades to points mapping. Let's try and see how our program behaves when we don't give it the values it expects and can handle properly.
Step by Step Solution
★★★★★
3.53 Rating (167 Votes )
There are 3 Steps involved in it
Step: 1
CODE IN PYTHON def getLetterGradeValuelettergrade grademapping A 40 B 30 C 20 D 10 F 00 ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started