Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

ASSIGNMENT: PROGRAMMING PROBLEM4

Amazon Books

Design and implement a C++ program to buy books on Amazon. The program should be menu based with the following options:

1. Enter Customer name
2. Add a book to a customer's shopping cart
3. Display the Customer's shopping cart
4. Search
5. List all books
6. Checkout

Requirements:

This problem is an extension of the Programming Project 3. You are to reuse the Book class you developed for that assignment. You will create a new Shopping program that contains the main, or modify your main program from Programming Project 3. You should read all the Books into an array which will serve as our "inventory" list when the program starts. You can then manipulate the books that are stored in the list.

Search should allow the user it input a keyword such as a name, title, or format. The program should display all books from the list that contain that keyword.

List all books should print the entire list, in a manner similar to what you did in Programming Project 3.

You are to develop a new Customer class following the UML below. That class should contain the customer's name(and mailing address if you so desire), an array to hold the list of books in the shopping cart, and a count of the number of books items in the shopping cart. This Customer class should have functions to:

- enter the customer's name from the keyboard
- add a book to the shopping cart list of books, and
- display the list of books in the shopping cart with a total price.

Each of these is discussed further below. You'll use a Customer class object in your main program in support of the first three menu items.
Entering a Customer's name is fairly trivial. Your Customer class function should just display a prompt and read a string value from the user.
Adding a book to the student's list requires two functions, one top-level function and one Customer class member function. The member function should simply copy its book argument into the next available spot in the shopping cart and update the count. The top-level function should ask the user to enter the title, find the book in "inventory" list and call the Customer member function to add this book to her/his shopping cart.

Displaying the shopping cart should print the customer's name, all their books and the total price in a neatly written report.

STEP 1-SETTING UP YOUR MAIN PROGRAM

Create a main Shopping program that will allow the customer to buy books on Amazon. Theprogram should allow the user to select from the menu listed above. We will use a list of books as our "inventory". The program should read the information from data file(Books.txt) for each book and place it into the list of books in the main before displaying the menu. After each user selection, the program should complete the task, then display the menu again.

STEP 2-WORKING WITH THE BOOK LIST

Menu items 4 and 5 should be able to be completed at this point since they simply display the entire list of books or search the list for what the user enters. Make sure you use functions to complete each task separately and call the functions in the logic for the menu selection. Menu item 6 can be started by exiting the program for now.

STEP 3-GETTING THE CUSTOMER ABLE TO CREATE AN ACCOUNT

Customer

-name:String
-shoppingCart:Book[]
-numItemsOrdered:int
-total():double

+Customer()
+~Customer()
+enterName():void
+display():void
+addToShoppingCart(item:Book):void

Write the Customer class from the UML as shown. You may add additional shipping information if you so desire. You may add get and set functions as needed. Modify the Shopping program so that the user can create a customer account. Modify menu item 6so that checkout can now display a receipt with just the customer's name (since the cart is empty) to test out the Customer class. You should pause the program after you display the receipt before you exit the program.

 

 

 

STEP 4-FILLING UP YOUR SHOPPING CART

Write the functions to add to the cart in both the Customer class and the Shopping program (see above descriptions). A user will enter the title of the book exactly as it is displayed to select the correct item to add to the cart. Edit the Customer class display method so that it displays the contents of the shopping cart after the customer's name. The total member function is a private function, called by the display function, which returns the total price of the books in the shopping cart. Thoroughly test your program by searching for and adding multiple books to your cart and checking out. The final displayed receipt should list the customer's name, the list of items purchased, and the total.
Extras for Experts:

Add a menu item to remove a book from a shopping cart.

Submission Guidelines:

All source code must include comments, be properly indented and use descriptive variable names where appropriate. Submit a zipped file of the project folder to the Programming Project 4 drop box in D2L. It should include Book.h, Book.cpp, Customer.h, Customer.cpp, and Shopping.cppfiles. I will be looking at the code and running the program. Your grade will depend on how it compiles and runs, if the desired output is produced, comments, and programming style.

Ethical Programming Guidelines

• This is an individual assignment; the work you turn in must be yours and yours alone.
• You are free to share conceptual ideas (BUT NOT CODE) with fellow students without any computing device present.
• You are free to use any example code provided by the instructor.
• You can consult SIs and the instructor for assistance with your code, but you must have your algorithm written before you will get help.
• You may NOT share code with another student.
• You may NOT "team" code.
• You may NOT coach code another student.
• You may NOT solicit help from the Internet (forums, crowd-source your project).

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92576185
  • Price:- $80

Priced at Now at $80, Verified Solution

Have any Question?


Related Questions in C/C++

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As