<br>
Scenario: <br>
You just landed a job as a junior Java developer and your project manager asks you to write an application to help customer service associates at a local marketplace accomplish their daily tasks. The local marketplace’s merchants sell their products to registered customers only. The project manager informs you that the application is broken into four major functional sections; Inventory, Customer, Purchases and Reports. All four sections are driven by a backbone database and perform similar tasks. He also explains that your application has to be a Java Swing Graphical User Interface application and to make things easier, he would like the application to be multiple-document interface oriented, if at all possible.<br>
Descriptions:<br>
Inventory: The inventory section will be used by the merchant to perform inventory tasks that will be reflected to the database. This section will have four submenus out of which, one will have two submenus.<br>
Inventory<br>
New<br>
Change<br>
Delete<br>
Export<br>
Tab Separated<br>
XML Format<br>
Customer: The customer section will be used by customer service associates to perform tasks on customers that are allowed to make purchases at the market place. This section will have four submenus out of which, one will have two submenus.<br>
Customer<br>
New<br>
Change<br>
Delete<br>
Export<br>
Tab Separated<br>
XML Format<br>
<br>
Purchases: The purchases section will be used by the merchant as a POS application at the marketplace. This section will have a single submenu which will allow the user start the POS application. The POS application will be the one portion of the program most frequently used. Once started, it should allow the merchant to Add/Delete a new purchase to the database. It should also allow the merchant to cancel a purchase before it is saved to the database; in other words, clear the information already entered.<br>
Purchases<br>
POS <br>
<br>
Reports: The reports sections will be used to generate properly formatted reports regarding the purchases, inventory and customers’ information. The generated reports will be saved to a file to be printed or read by a text editor program like Notepad, Word, etc.<br>
Reports<br>
Customer<br>
Summarized<br>
Detailed<br>
Inventory<br>
Summarized<br>
Detailed<br>
Purchases<br>
Detailed<br>
Summarized<br>
<br>
<br>
Assignment:<br>
Write an application to accomplish the tasks defined in the sections above. Your instructor will give you further instructions regarding the database tables’ structure. If you are unsure on how to connect to a database using JDBC, read Chapter 24 (Accessing Databases with JDBC) in your textbook. Also, if you choose to create this application as a multiple-document interface application (MDI), refer to Chapter 22 section 7 (<a href=”https://22.7? target=”_blank”>22.7</a>) of the textbook.<br>
In addition to your menus, you should have a Help -> About menu at the end of your menus which will display a dialog box with information regarding the program. I suggest you use the three lines at the heading of this document and add your Last Name, First Name and an Ok button to the dialog which will close it when clicked on.<br>
<br>
Database tables:<br>
<br>
CONNECT ‘jdbc:derby:SAMPLE;create=true’;<br>
CREATE TABLE <a href=”https://SAMPLE.MEMBERS” target=”_blank”>SAMPLE.MEMBERS</a> (Id VARCHAR(10) NOT NULL, firstName VARCHAR(50), lastName VARCHAR(50), address VARCHAR(150), city VARCHAR(50), state CHAR(2), zipCode CHAR(5), dob DATE, annualFee DECIMAL(5,2), PRIMARY KEY(Id));<br>
CREATE TABLE <a href=”https://SAMPLE.STORE” target=”_blank”>SAMPLE.STORE</a> (Id INT NOT NULL, PRIMARY KEY(Id));<br>
CREATE TABLE <a href=”https://SAMPLE.PARTS” target=”_blank”>SAMPLE.PARTS</a> (Number CHAR(10) NOT NULL, Name VARCHAR(500), Price DECIMAL(9,2) CONSTRAINT Price_ck CHECK(Price > 0), onHand INT CONSTRAINT onHand_ck CHECK(onHand > 0), Image blob(2M), PRIMARY KEY(Number));<br>
CREATE TABLE <a href=”https://SAMPLE.SALES” target=”_blank”>SAMPLE.SALES</a> (Id INT NOT NULL GENERATED ALWAYS AS IDENTITY, StoreId INT NOT NULL, MemberId VARCHAR(10), PartNumber CHAR(10), Purchase_Date DATE, Quantity int, Price_Paid DECIMAL(9,2), CONSTRAINT Quantity_ck CHECK(Quantity > 0), CONSTRAINT PricePaid_ck CHECK(Price_Paid > 0), FOREIGN KEY (MemberId) REFERENCES <a href=”https://Sample.Members” target=”_blank”>Sample.Members</a>(Id), FOREIGN KEY (PartNumber) REFERENCES <a href=”https://Sample.Parts” target=”_blank”>Sample.Parts</a>(Number), FOREIGN KEY(StoreId) REFERENCES <a href=”https://Sample.Store” target=”_blank”>Sample.Store</a>(Id), PRIMARY KEY(Id));<br>
<br>
Database Data:<br>
<br>
INSERT INTO <a href=”https://Sample.Members” target=”_blank”>Sample.Members</a> (Id, firstName, lastName, address, city, state, zipCode, dob, annualFee) VALUES (‘426873?,’Joseph’,’Garrison’,’94 Barbara Dr’,’Syosset’,’NY’,’11791?,’12/12/1990?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘318765?,’Jessica’,’Bracco’,’125 Beverly Ave’,’Copiague’,’NY’,’11726?,’6/15/1986?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘143578?,’Rosario’,’Lugo’,’254 Brook Path’,’North Bellmore’,’NY’,’11710?,’8/21/1979?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘478035?,’Nicholas’,’Mc Kenna’,’87 Magenta Ln’,’Brewster’,’NY’,’10509?,’2/5/1981?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘963105?,’Daniel’,’Locasto’,’92 Lincoln Ave’,’Franklin Square’,’NY’,’11010?,’3/14/1950?,<a href=”https://0.00? target=”_blank”>0.00</a>),(‘852645?,’Austin’,’Lambert’,’1287 Oak St’,’Levittown’,’NY’,’11756?,’11/25/1988?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘437915?,’Jason’,’Stern’,’1478 E 87th St’,’Brooklyn’,’NY’,’11236?,’12/3/1980?,<a href=”https://35.00? target=”_blank”>35.00</a>),(‘701237?,’Megan’,’Pidgeon’,’96 Brookwood Dr’,’Kings Park’,’NY’,’11754?,’4/9/1949?,<a href=”https://0.00? target=”_blank”>0.00</a>);<br>
INSERT INTO <a href=”https://Sample.Store” target=”_blank”>Sample.Store</a> (Id) VALUES(11653471),(14367598),(22458790),(24563798),(33798105),(43520179),(74025469),(75946345),(78103204),(87932154);<br>
INSERT INTO <a href=”https://Sample.Parts” target=”_blank”>Sample.Parts</a> (Number,Name,Price,onHand,Image) VALUES (‘169139?,’Generac XG8000E Portable Generator | 10,000 Surge Watts, 8000 Rated Watts, Electric Start, Model# 5747’,<a href=”https://1369.99? target=”_blank”>1369.99</a>,11, DEFAULT),(‘47674?,’Honda EU7000 Portable Generator | 7000 Surge Watts, 5500 Rated Watts, Electric Start, CARB-Compliant, Model# EU7000’,<a href=”https://3999.99? target=”_blank”>3999.99</a>,5, DEFAULT),(‘1572041?,’NorthStar Gas Cold Water Pressure Washer | 4000 PSI, <a href=”https://3.5? target=”_blank”>3.5</a> GPM, Honda Engine, Belt Drive, Model# 1572041’,<a href=”https://1699.99? target=”_blank”>1699.99</a>,7, DEFAULT),(‘8655?,’Gravel Gear Utility Work Gloves’,<a href=”https://16.99? target=”_blank”>16.99</a>,51, DEFAULT),(‘590122?,’Radians Class 2 Surveyor Safety Vest’,<a href=”https://19.99? target=”_blank”>19.99</a>,120, DEFAULT),(‘2177?,’Ergodyne GloWear Fire-Resistant Modacrylic Safety Vest | Class 2, Lime’,<a href=”https://82.99? target=”_blank”>82.99</a>,27, DEFAULT),(‘399682?,’DEWALT Heavy-Duty Double-Bevel Sliding Compound Miter Saw | 10in., Model# DW717’,499,15, DEFAULT),(‘46463?,’Ironton 10in. Compound Sliding Miter Saw | <a href=”https://2.4? target=”_blank”>2.4</a> HP, 15 Amp, 4,600 RPM’,<a href=”https://149.99? target=”_blank”>149.99</a>,30, DEFAULT),(‘22453?,’Milwaukee Abrasive Chop Saw | 14in., Model# 6177-20’,<a href=”https://159.99? target=”_blank”>159.99</a>,14, DEFAULT),(‘44765?,’Kenwood ProTalk UHF Handheld Radio | Model# TK3402U16P’,<a href=”https://289.99? target=”_blank”>289.99</a>,6, DEFAULT),(‘42865?,’Pair of Black 50-Mile Submersible 2-Way Radios | Model# GMR5089-2CKS’,<a href=”https://99.99? target=”_blank”>99.99</a>,8, DEFAULT),(‘42436?,’Troy-Bilt Walk-Behind Jet Sweeper | 205cc Briggs & Stratton Engine, 1000 CFM, Model# 24A-672J766’,<a href=”https://399.99? target=”_blank”>399.99</a>,6, DEFAULT),(‘31801?,’Ohio Steel Lawn Sweeper | <a href=”https://42in.W” target=”_blank”>42in.W</a>, 22 Cu. Ft., Model# 42SWP22’,<a href=”https://259.99? target=”_blank”>259.99</a>,7, DEFAULT),(‘32001?,’Ironton Poly Sprayer | 2-Gallon, 45 PSI, Model# 32001’,<a href=”https://16.99? target=”_blank”>16.99</a>,25, DEFAULT),(‘46530?,’Strongway Dump Cart | 1,200-Lb. Capacity, 5 Cu. Ft.’,<a href=”https://159.99? target=”_blank”>159.99</a>,9, DEFAULT),(‘46438?,’Strongway Jumbo Wagon | <a href=”https://48in.L” target=”_blank”>48in.L</a> x <a href=”https://24in.W” target=”_blank”>24in.W</a>, 1,400-Lb. Capacity’,<a href=”https://99.99? target=”_blank”>99.99</a>,3, DEFAULT),(‘14264?,’Lawn-Revitalizing Aerator Shoes’,<a href=”https://9.99? target=”_blank”>9.99</a>,47, DEFAULT),(‘44039?,’LaCrosse Wireless Weather Station | Get a Full Color Forecast, Model# 308-146’,<a href=”https://59.99? target=”_blank”>59.99</a>,39, DEFAULT),(‘168101?,’Electrostatic Cling Outdoor Window Thermometer’,<a href=”https://5.99? target=”_blank”>5.99</a>,73, DEFAULT),(‘27442?,’Landmann Haywood Wildlife Fireplace | Black, <a href=”https://33in.H” target=”_blank”>33in.H</a>, Model# 25319’,<a href=”https://89.99? target=”_blank”>89.99</a>,17, DEFAULT),(‘121102?,’Sundanzer Solar-Powered Chest Freezer | 8 Cubic Ft., <a href=”https://30in.L” target=”_blank”>30in.L</a> x <a href=”https://50in.W” target=”_blank”>50in.W</a> x <a href=”https://37in.H” target=”_blank”>37in.H</a>’,1299,2, DEFAULT),(‘40091?,’Sunforce Wind Turbine | 1500 Watts’,<a href=”https://3799.99? target=”_blank”>3799.99</a>,2, DEFAULT),(‘47472?,’Coleman 400 Watt Wind Turbine with Tower Kit | 27 Amps, Model# 48640’,<a href=”https://899.99? target=”_blank”>899.99</a>,8, DEFAULT),(‘121072?,’Sunforce Tower Kit for Small WInd Turbines | Model# 45455’,<a href=”https://449.99? target=”_blank”>449.99</a>,8, DEFAULT),(‘48923?,’Troy-Bilt Vortex 3-Stage 28in. Electric Start Snow Blower | 357cc Engine, Model# 31AH55Q8766’,<a href=”https://1299.99? target=”_blank”>1299.99</a>,20, DEFAULT);