C++ customer database | Computer Science homework help

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:

1.     Add a new customer in the list (take input from user, all the fields and add a new customer)

2.     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.

3.     Add a product as in the list of currently bought products of a customer (by customer’s first name). You should ask two things, the first name of the customer to know which customer is buying something, and the product information to add that product in the list of products of this particular customer.

4.     Delete a product from the list of products of a customer. You should ask first customer’s first name and then product name in order to delete it from the list.

5.     Print all the customers along with their list of products in the entire list.

6.     Delete all the products of a particular customer (by customer’s first name).

7.     Delete all the customers from the list. This includes deleting all the products of each customer..

The following diagram shows how the linked list should look like. Please note about the following diagram of linked list: (Also note that the dotted line arrows in the following diagram are comments)

1)    CustomerDatabase is the name of the head of the linked list that contains all of your customers (shown as the first row of list).

2)    Each Node represents a customer which contains all the fields mentioned above including:
                  a) one pointer “next” that points to the next customer in the list (shown by an arrow on
                  the right hand side of each node on the first line).
                  b) one pointer “items” (shown by an arrow in the bottom of each node) which
                   points to the linked list containing the list of items bought by this customer.

3)    In this diagram, each node only mentions first name of the customer. However, it also contains other fields as mentioned above, but that is not shown in the diagram to keep it simple.

These are “next” pointers inside product object, pointing at object of type “product”

 


These are “next” pointers pointing at object type “customer”

CustomerDatabase

       
 
 
   

 

 

 

 

 

 

 

 

 

 

 

 

assignment Output Screen:

When I run the assignment, it should look like the following:

 

Please select any item from the following menu:

1:     Add a new customer in the list

2:     Delete a customer from the list

3:     Add a product in the list of currently bought products of a customer

4:     Delete a product from the list of products of a customer.

5:     Print all the customers along with their list of products

6:     Delete all the products of a particular customer

7:     Delete all the customers from the list.

Ø   (here I will type a number from the above menu)

 

Now, after I see the above menu, I will make a selection from 1 to 10. Based on my selection, your program should call some function to carry out the operation needed for that selected task.

After that operation is performed, you should show me the above mentioned selection menu again. This should continue in an infinite loop until I want to exit the program.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more