layout: post author: ericabrody title: “Erica’s Chapter 4 Exercises” —

Here is the redo of the pay calculation using functions:

Here is the redo of the program to convert scores to grades:

Reflections: For these programs, I thought about the user experience - I wanted to let users re-enter their input if their initial input was invalid, rather than just giving them an error message and ending the program.
For the calculation of the pay - my original program did not provide error messages about the variable being a string until AFTER the user input BOTH hours and rate, so I changed the program to give the user an error message after entering invalid input for hours until a valid hours number was provided and then doing the same thing for rate.