Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an application (ShoppingCart.java) that works like a shopping cart system for a book store. Consider a file titled book-prices.txt. A sample template of the

Create an application (ShoppingCart.java) that works like a shopping cart system for a book store. Consider a file titled book-prices.txt. A sample template of the file is given below:

book-prices.txt

I Did It Your Way;11.95 The History of Scotland;14.50 Learn Calculus in One Day;29.95 Feel the Stress;18.50 Great Poems;12.95 Europe on a Shoestring;10.95 The Life of Mozart;14.50

Each line in the file contains the names and prices of various books delimited by a ;. When your application begins execution, it should look for book-prices.txt (use the exact file name) file in the project directory. It should read the contents of the file and store the book titles in a list component. The user should be able to select a title from the list and add it to a shopping cart, which is simply another list component. The application should have buttons or menu items that allow the user to remove items from the shopping cart, clear the shopping cart of all items, and also check out. When the user checks out, the application should calculate and display the subtotal of all the books in the shopping cart, the sales tax (6% of the subtotal), and the total.

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions