Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Java GUI application that works like a shopping cart system for an online book store. You will be provided a file named BookPrice.txt.

Create a Java GUI application that works like a shopping cart system for an online book store. You will be provided a file named BookPrice.txt. This file contains the names and prices of various books, formatted as follows: 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 Each line in the file contains the name of a book, followed by a comma, followed by the books retail price. When your application begins execution, it should read the contents of the file and store the titles in a ListView. The user should be able to select a book from the list and add it to the Shopping Cart. The Shopping Cart is another ListView. The application should have buttons or menu items that allow the user to Add Selected Items, Remove Selected Items, and Check Out. When the Check Out button is selected, the application should calculate and display the subtotal of all books in the shopping cart, the sales tax of 7%, and the total. It should also create a receipt file, which should be a text file that includes the books purchased, the quantities of each book purchased, their prices, and total price both before and after taxes. Here is an example of what the receipt file could look like: (File Name would be Receipt-02-41-2018.14.52.56.txt)

Receipt: 02-41-2018 14:52:56

Title Price

----------------------------------- ---------

The Life of Mozart $ 14.50

Java How to Program $151.55

Feel the Stress $ 18.50

Core Java $ 38.27

Sub Total $222.82

Tax $ 15.60

---------

Grand Total $238.42

To exit the application, click the x in the upper right corner.

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_2

Step: 3

blur-text-image_3

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 Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions