Question: Modify the CreditCard class from Code Fragment 1.2 to charge a late fee for any payment that is past its due date. Data from in
Modify the CreditCard class from Code Fragment 1.2 to charge a late fee for any payment that is past its due date.
Data from in Fragment 1.2
A typical C++ program includes many different header files, which often include other header files. As a result, the same header file may be expanded many times. Such repeated header expansion is wasteful and can result in compilation errors because of repeated definitions. To avoid this repeated expansion, most header files use a combination of preprocessor commands. Let us explain the process, illustrated in Code Fragment 1.2.

#include "Credit Card.h" using namespace std; Credit Card::Credit Card (const string& no, const string& nm, int lim, double bal) { number = no; } name = nm; balance = bal; limit = lim; bool Credit Card::chargelt (double price) { if (price + balance > double(limit)) return false; balance + price; return true; } } void Credit Card::makePayment(double payment) { // make a payment balance payment; } < < "Name = " < < "Balance < < "Limit return out; // provides Credit Card // make std:: accessible // standard constructor ostream& operator
Step by Step Solution
3.24 Rating (153 Votes )
There are 3 Steps involved in it
ifndef CREDITCARDH define CREDITCARDH class CreditCard public CreditCardint customer int number int ... View full answer
Get step-by-step solutions from verified subject matter experts
