Answered step by step
Verified Expert Solution
Question
1 Approved Answer
R - 2 . 5 Use the techniques of Section 1 . 7 to revise the charge and make - payment methods of the CreditCard
R Use the techniques of Section to revise the charge and makepayment methods of the CreditCard class to ensure that the caller sends a number as a parameter.
R If the parameter to the makepayment method of the CreditCard class were a negative number, that would have the effect of raising the balance on the account. Revise the implementation so that it raises a ValueError if a negative value is sent.
R The CreditCard class of Section initializes the balance of a new account to zero. Modify that class so that a new account can be given a nonzero balance using an optional fifth parameter to the constructor. The fourparameter constructor syntax should continue to produce an account with zero balance.
R Modify the declaration of the first for loop in the CreditCard tests, from Code Fragment so that it will eventually cause exactly one of the three credit cards to go over its credit limit Which credit card is it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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