Error checking with meaningful error messages is an important part of programming. Consider the following scenario: A customer has to pay his monthly credit card bill. The credit limit on the card is $1000. The minimum payment due is always $20. Let the payment on the credit card be $P. Write a function called make payment(P) that takes as an argument the total payment on the credit card ($P) and prints “Success” or “Retry”. Try to think of all the errors that should be taken care of and implement those in the function. One example would be that if the payment is less than $20, the program should remind the user that it’s less than the minimum payment due.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here