Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Sample text file (Excerpt): (Note format: item number, name, category, price, and quantity listed on separate lines for each attribute with no blank line(s) between
Sample text file (Excerpt): (Note format: item number, name, category, price, and quantity listed on separate lines for each attribute with no blank line(s) between items.) 100 Doctor Who: Deep Time Books 8.47 1 101 Doctor Who: Heart of Stone Books 9.99 1 800 Doctor Who TARDIS Bookends Set of 2 Home & Gifts 51.95 1 801 WonderFlex Light, Black Home & Gifts 18.95 1 500 Acoustic Christmas Music 31.34 1 501 Hamilton (Original Broadway Cast Recording) Music 22.39 1
1. Problem: Create a Java application that implements an online store complete with shopping cart and check out procedure. To clarify the problem, I have divided it into 4 parts. Part I Create Store Inventory. The program begins by creating an online store inventory from a list of items stored in a text file. A try-catch block must be used to handle checked exceptions. Part 2: Create/Add to/Remove from Shopping Cart. After creating the store inventory, the program welcomes the customer, then provides him/her with a menu of options for creating a shopping cart, adding items to or removing items from the shopping cart, or checking out. Creating a shopping cart entails creating an empty shopping cart. Adding an item to the shopping cart entails searching the store inventory first by category then by item to locate an item to add. (If the customer chooses to add an item that is already in the cart, simply increase the quantity by one.) Removing an item from the shopping cart entails displaying the current contents of the shopping cart, then prompting the customer to enter the number of the item to remove. The shopping cart must be displayed after each addition or removal. All customer input must be validated. try-catch blocks must be used to handle unchecked exceptions. The program continues to display the main menu until the customer decides to check out. Part 3: Check Out. Once the customer selects check out, the program displays a summary of the customer's order. Next, the program asks the customer how s/he wishes to pay for the order. If the customer chooses1 to charge to a credit card on file, the program simply displays the payment summary. If the customer chooses 2 to charge to a new credit card, the program prompts the customer to enter payment information (card holder full name, followed by card type, number, and expiration date), then displays the credit payment summary. Both payment summaries must be formatted as shown in the sample runs. The customer's choice of payment option must be validated. With respect to the credit card information, you need only check that the card number consists of 16 digits. try-catch blocks must be used to handle unchecked exceptions. Part4 Thank Customer. Finally, the program thanks the customer for visiting the online store .All items must be stored in and read from a text file. An example of recommended formatting for the text file appears at the end of this document. Java code that accesses the text file must be enclosed in a try-catch block. Minimally, your program must handle the FileNotFoundException. . 1. Problem: Create a Java application that implements an online store complete with shopping cart and check out procedure. To clarify the problem, I have divided it into 4 parts. Part I Create Store Inventory. The program begins by creating an online store inventory from a list of items stored in a text file. A try-catch block must be used to handle checked exceptions. Part 2: Create/Add to/Remove from Shopping Cart. After creating the store inventory, the program welcomes the customer, then provides him/her with a menu of options for creating a shopping cart, adding items to or removing items from the shopping cart, or checking out. Creating a shopping cart entails creating an empty shopping cart. Adding an item to the shopping cart entails searching the store inventory first by category then by item to locate an item to add. (If the customer chooses to add an item that is already in the cart, simply increase the quantity by one.) Removing an item from the shopping cart entails displaying the current contents of the shopping cart, then prompting the customer to enter the number of the item to remove. The shopping cart must be displayed after each addition or removal. All customer input must be validated. try-catch blocks must be used to handle unchecked exceptions. The program continues to display the main menu until the customer decides to check out. Part 3: Check Out. Once the customer selects check out, the program displays a summary of the customer's order. Next, the program asks the customer how s/he wishes to pay for the order. If the customer chooses1 to charge to a credit card on file, the program simply displays the payment summary. If the customer chooses 2 to charge to a new credit card, the program prompts the customer to enter payment information (card holder full name, followed by card type, number, and expiration date), then displays the credit payment summary. Both payment summaries must be formatted as shown in the sample runs. The customer's choice of payment option must be validated. With respect to the credit card information, you need only check that the card number consists of 16 digits. try-catch blocks must be used to handle unchecked exceptions. Part4 Thank Customer. Finally, the program thanks the customer for visiting the online store .All items must be stored in and read from a text file. An example of recommended formatting for the text file appears at the end of this document. Java code that accesses the text file must be enclosed in a try-catch block. Minimally, your program must handle the FileNotFoundExceptionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started