In this checkpoint, you will be expanding the previous assignment in two significant ways. This assumes you have a working version of the Bookstore project from the previous assignment. If you were...

2 answer below »

In this checkpoint, you will be expanding the previous assignment in two significant ways. This assumes you have a working version of the Bookstore project from the previous assignment. If you were not able to complete that assignment, or if your project had significant issues that affected functionality, please make sure to get in touch with someone on the instructional team to help get your project caught up so you are ready for this one.



Preliminaries


I can not iterate the importance of having a working implementation that meets the requirements of project 2.


You do not need to start a new NetBeans project for this submission. You can use your existing Bookstore project as a starting point. If you choose to create a new project it should be namedlastNameFirstNameProject3.



Part A – Inventory Tracking


In this part we want to change the way our inventory tracking works. Likely, you have some sort of starting inventory hard coded into your BookStore class, but this creates a situation where every day of your bookstore’s operation is completely identical (i.e., every time we run the simulation we get the same output). In order to make this both more interesting and realistic, in this section you will be altering the execution of your bookstore such that rather than generating a fixed inventory when run, the inventory will be created by parsing through an external file at execution time.


A simple way used to store tabular data, such as a spreadsheet or database, in a text file is using a format known as Comma Separated Values (CSV). In this format the comma in this format is a delimiter, which is a character that separates the columns of a table.Using the comma character to separate (or delimit) data is the most common, but sometimes we use other characters, like semicolons. This is important if the actual data contains commas since that will interfere with the file structure.


For example, let's say you had a spreadsheet containing the following data we can create a CSV file using a text editor such as Notepad or TextEdit.



























Email




Name




Hometown



[email protected]



John Newman



Chicago



[email protected]



Marie Robinson



San Francisco



[email protected]



Cali Williams



Seattle



The contents of the text file would look like:


Email, Name, Hometown
[email protected], John Newman, Chicago
[email protected], Marie Robinson, San Francisco
[email protected], Cali Williams, Seattle


Take a look at the format and content ofthis file

Download this file
.



book inventory csv


This file format, .csv. You should use this table to populate the inventory of your bookstore by using the relevant information to create your Product objects.


Once your inventory is populated, the program should proceed as described in Part A. When the day ends, the following should happen:



  • An end of day report should be generated as a .txt file.


    • This file should include what products were purchased, how many new members were registered, total sales and revenue, and any other information you think is relevant.

    • It is up to you to figure out the proper formatting to this file. It should be clear, readable, and make sense.


  • An updated inventory file. This file should follow the same .csv format, but have updated stock numbers. This file should have a slightly different name, such as BookInventoryDay2.csv.


**NOTE**- If you would like to create your own .csv inventory list, you may do so. However, keep in mind that you will need to submit that along with the rest of your files.


Point distribution - inventory loaded from file (5 points), end of day report (5 points), updated inventory file (5 points)



Part B – Changing the Test Harness


The other change we’ll be making to the project is a potentially small alteration to the test harness code. Our goal with these changes is to alter the flow of the test harness such that the execution of your program represents one day of our bookstore being open. The most important aspect of this is the idea of a starting inventory (the products available for purchase at the start of the day) and an ending inventory (purchased products subtracted from the inventory).


Update the test harness to utilize the updates made to the inventory tracking such that before the program exits the end of day report and updated inventory file are generated.



Part C – Handle Exceptions


There is a lot of user input using the scanner class in this project. Usage of the scanner class can lead to lots of different exceptions being thrown (i.e., What if the user enters a letter when you are expecting a number? or the other way around?). There is also the use of the File I/O classes and methods when the read from and write to files. You should catch these exceptions in the program and write out an error message.



  1. Catch InputMismatchException when you ask the user for a number using nextInt() or nextDouble().

  2. Catch general Exception in a try block around all scanner input calls, as a way to check for the many possible errors that can occur when asking the user for input.

  3. Catch FileNotFoundException when you have open/close file operations

  4. Catch IOException



Suggested Additions for Extra Credit!



  • Add in one more additional function as described in Project 2

  • Institute a daily sale! One way to do this would be to randomly select one item to receive a discount. How this affects sales and revenues should be noted in the end of day report.

  • Have something in mind? suggest it for possible consideration.



Coding Style


This grade is awarded for proper coding styles. This includes:




    • Appropriate promptsand informative output

    • Appropriate method, variable and object names

    • Proper indentation

    • Good commenting (explains what code is doing)

    • Well-organized, elegant solution




Submission Requirements:



  1. Submit your NetBeans project export that includes your program to fulfill the requirements. (lastNameFirstNameProject3.zip)

  2. Your initial inventory file if different than what was provided.

  3. Submit the UML Diagram that corresponds with your project.

  4. Submit a PDF document with the nameproject3Info.pdfthat includes the following assignment information:

    • Explanation of any special or additional features you added, if any.

    • If your solution to this problem is incomplete, you may explain the status as of your submission and describe any issues that kept you from completing the assignment.

    • Discuss the easy and challenging parts of the assignment. How did you overcome all or some of the challenges?

    • Did you learn anything that will help you perform better in the future?



Answered 9 days AfterApr 18, 2022

Answer To: In this checkpoint, you will be expanding the previous assignment in two significant ways. This...

Robert answered on Apr 27 2022
92 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here