Answered step by step
Verified Expert Solution
Link Copied!

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! :)

image text in transcribedimage text in transcribedimage text in transcribed

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 functions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions