Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

inventory.txt 6 Tweny Thousand Leagues Under the Sea Jules Verne 20.99 10 A Tale of Two Cities Charles Dickens 15.99 15 The House of the

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

inventory.txt

6

Tweny Thousand Leagues Under the Sea

Jules Verne

20.99

10

A Tale of Two Cities

Charles Dickens

15.99

15

The House of the Seven Gables

Nathaniel Hawthorne

12.99

13

Around the World in 80 Days

Jules Verne

11.99

3

Flatland: A Romance of Many Dimensions

Edwin Abbott

8.99

18

Alice in Wonderland

Lewis Carroll

14.99

11

CODE SHOULD BE IN C++

The purpose of this project is to work will pointers and dynamic memory. The project will be an app for customers to buy books from a bookstore's website. A customer can add books to a shopping cart and remove them too. A customer gets a discount of 905 for every 5 books they buy. The user chooses books from a catalog of books that are stored in a file When the program ends, it prints the total amount paid for the books plus how much the customer saved. What To Code The book list will be in a file called 'inventory.txt The format will be in this order: counts etitle1> cauthor1> cinStock1> cinStock2> and so on. The first line of the file will have the number of books in the list. Create the book inventory list to be this size. Don't fix the size of the array at compile time You need to make at least 2 classes. I would suggest a class for the book information and a class for storing the inventory of books. You could also have a class for storing the shopping cart list for keeping track of what book is being bought and how many copies but you can also store this list in the same class as the inventory list. Tasks A user can do the following -print all books in the inventory -print current contents of shopping cart - also print the total amount and current discount. -add book to cart ask user for a book title. Then ask to how many copies. This should also decrease the in stock amount of the book in the inventory. Re-figure both discount and total, each time a book is added or the number of copies is changed. NOTE: If the user enters a title already in the cart, you can let them change the quantity in the

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

internationalization of business?

Answered: 1 week ago