c++ programing


put a comment for each step you do.





Document Preview:



Customer Database
Assume that you are running a business where customers come and buy your products from your shopping store. So you need to create a database which maintains a list of all of your customers and whatever each customer bought from your store.
You should create two classes, one for Customer and the other for Product. A Customer should have at least the following parameters: (Please note that you may add additional parameters of your choice for each customer if it helps you in any way)
First Name: string Last Name: string Customer type:string, Note that this parameter defines the type of customer based on the following conditions: if this customer has purchased items worth less than $100, his types is “normal” else if this customer has purchased items worth less than $1000, his types is “good” else if this customer has purchased items worth more than $1000, his types is “excellent”
items: Product * (this field is of type Product pointer which points to the object of type Product) next: Customer* (this pointer will point to the next customer in the list) A Product should have at least the following parameters: (Please note that you may add additional parameters of your choice in this class if it helps you in any way)
Name of product: string Price of this product: double next: Product* (this pointer will point to the next product in the list)
You should create a pointer, say CustomerDatabase, as the head of the database which points to the first customer in the linked list.
Customer * CustomerDatabase = NULL; //this pointer is the head of the linked list. Don’t call it head.
You should provide functions to support the following operations:
Add a new customer in the list (take input from user, all the fields and add a new customer)
Delete a customer from the list (based on customer’s first name). Notice that deleting a customer should delete all the products that the customer bought so far.
Add a product as in the list of currently bought...






Comments