Answered step by step
Verified Expert Solution
Link Copied!

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.


Run the GPA Calculator program and try the scenario that uses negative values when prompted for a letter grade, and negative and zero values for the credit hours.

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 ... 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

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Programming questions

Question

1. Give a full definition of the market for foreign exchange.

Answered: 1 week ago

Question

How many applicants are you interviewing?

Answered: 1 week ago

Question

Compute altmans five factors/ratios

Answered: 1 week ago