Question: You have been employed to create program to assist the manager of a coffee shop. You decide to make a prototype application in Java to
You have been employed to create program to assist the manager of a coffee shop. You decide to make a prototype application in Java to show what you can do, and to be able to ask the manager what features he/she would like to be developed in the complete version you will create for them in the coming months. Your prototype needs to demonstrate creating a database (tables and their data), modifying the records in it with values from the user, and perform validation on all input from the user (to reduce errors.) This application allows customers to run tabs (carry a credit with the store) as the store itself is in a large office building and sometimes large orders will come in for meetings and are then later paid by the individual or by their company. To facilitate this the system must keep customer data including a credit limit. Here are the requirements for this project.... General Requirements You must use NetBeans. This is to ensure that the project can be graded, and database access is the same. Create derby database called dbCoffeeStoreData in Java. Store it in the localhost location as we learned in class during the lecture on databases when this project was assigned. (This is very important in testing. Your database will not be created on my machine and is partly a manual process. You need to have the same name and location as the one I am going to create before I import your project for testing.) Database Schema / Create Table Statements Your project must have create statements for the following tables. Please create your own field names as ones in this description with spaces (like customer number) are invalid field names. Customer Table: customer number, first and last name fields, street, city, state, zip, phone, and email address as well as credit limit (must be double). Coffee Table: coffee id, coffee name, coffee description, price (must be double), number in stock (must be integer). Orders Table: order id, customer id, coffee id, number ordered (must be double), and the total(must be double). (5 points) [Note: The Orders Table is holding a total because prices are subject to change. The coffee shop runs occasional specials on some products to bring in customers. In a later prototype you would be storing the date in the Orders Table as well to track this.... but you are avoiding dates in the first prototype...this project...because the conversions can be tricky.] [Note2: The Create and Drop table statements will be taught during the lecture on databases. They are not in the Deitel book but will be covered in the lecture.] Insert Statements Create Insert Statements which will add 5 records with sample data into the Customer Table, 5 records into the Coffee Table, and 10 records (you must have some orders for at least 4 of the 5 customers and the orders must include at least 3 of the 5 coffees so you have a mix of them in these 10 records) into the Orders table. If you want more than these 20 insert statements...add them. You must represent at least 4 customers and e different coffees in the orders. But if you want to add extra records to make even more interesting reports...by all means do so. (5 points) Drop Statements This is a proof-of-concept prototype. So, you will be creating the tables with your start test data several times. To do this you must be able to delete the tables that are currently there. Create the Drop Statements which will Drop/delete the Customer, Coffee, and Orders tables. (5 points) Main Interface Create main screen JFrame with a logo image, a short paragraph about the company, and controls (buttons or links) to navigate to the other screens the side on the left side. Alternately, for the controls you can have them in a menu. The controls to show other screens should include ones to: Display Coffees, Display Customers, Display Orders for Customer, New Customer, and New Order. As this is a testing prototype. This screen also should have buttons or similar controls to: Create Database and Reset Database. Write code under the navigation controls to show the appropriate screen. (Create JFrame object of the type below and show it on the screen for the user.) Write code under the testing controls to connect to the database and: Create Database: execute the create statements to make the three tables and insert the starting data. Reset Database: execute the drop statements, create statements, and insert the starting data. Make sure to include Try/Catches around the code that makes database commands of course and give the user an appropriate message if there is a problem. (You will have to do this any way, or the program will not compile in NetBeans on a database connection.) (15 points) Display Customer Interface Create JFrame that shows the information in the Customer Table for the user. It should be presented in a grid or table. Keep the same look and feel of the main interface (same fonts and colors.) [Note: For this and all interfaces other than the main one you will probably need to change the default close operation on these Frames to DO_NOTHING_ON_CLOSE or HIDE_ON_CLOSE . That will keep the program from ending if the user closes them to work with the main screen.]
Step by Step Solution
3.60 Rating (157 Votes )
There are 3 Steps involved in it
Heres an outline of the project structure Database Configuration and Connection Set up a Derby database named dbCoffeeStoreData in NetBeans Database T... View full answer
Get step-by-step solutions from verified subject matter experts
