Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ plz! :) Construct a customer class that keeps track of a Customer purchases, credit line, and total balance. An object in the customer class
C++ plz! :)
Construct a customer class that keeps track of a Customer purchases, credit line, and total balance. An object in the customer class will have a name, an address, a credit limit (set to $1500) as well as other data fields. Declare and define data fields, include a constructor to populate the data fields, and implement member functions such that you can perform the following: Extract data members if needed. Keep track of number of sales, and total balance. Specify if a new purchase would exceed the credit limit. If the cost of an item to be purchased, added to the unpaid balance, surpasses the Customer's credit limit, do not allow the sale and output "Not enough credit limit. Purchase cannot be completed Otherwise show "Purchase successful." Write a program that tests the features of the customer class. Figure 1 shows a sample output. You can use the following pseudocode as a template #include header files using namespace std; class customer public: Customer (parameters) string get-name C) const double get-credit-limit const bool add-purchase (double val double get-total-balance const int get-num-purchases C) const private: data field Definition of constructor and member functionsStep 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