Reference no: EM132307941
Overview
VodaSam is a small internet provider with 10 shops. These shops also sell/provide phones as part of contracts.
The phones are ordered by the shops from central office. The project requires you to build an application that creates an order, saves it to a database and has the capacity to retrieve an order from a database. An example of the application is shown below

The administrator selects a shop from the dropdown list.
He/she enters an order number.
The administrator ten selects a product from the dropdown list and the price for that product is automatically retrieved appears on the price text field.
The administrator then selects the quantity of that product. The program then automatically calculates price * quantity and puts the results in the order value text field.
If the administrator is satisfied, he/she presses the addItem button and the details are added to the table.
Once all the items for the order are added, the administrator presses the save button and the details from the table along with the shop name and order number are saved to the database and table and order number field are cleared ready for the next order.
If the administrator wants to retrieve an order, they enter the order number and press the retrieve button and the order is retrieved into the table.
Details
There will be 3 phases.
• Phase 1 - creating the model classes and junit tests for them.
• Phase 2 - creating the user interface, linking it to the model and making the requirements as described in the overview operational (except for saving and retrieving from the database.
• Phase 3 making the database aspects operational
As well, 2 marks will be allocated for proper documentation in the program and 4 marks will be allocated for a word report on the design of the program and any issues that arose in writing the program.
The model, junit tests and user interface should all be in separate source folders.
A detailed marking scheme is attached at the end of this document.
Phase 1
There will be 2 classes in the model -ProductsandShops and DBConnectivity.
Products
This class will contain 3 attributes each an Array of Strings (phone, price, quantity).
The Array of phones will contain as the list implies, a list of phones. The Array of prices will contain the wholesale prices of the phones. The sequence of wholesale prices will correspond to the sequence of phones. That is the first phone in the phone array's price will be the first price in the price array.
The 2 arrays are listed below
Phone
|
Price
|
Apple iPhone 6S 32GB
|
264
|
Apple iPhone 7 32GB
|
374
|
Apple iPhone XR64GB
|
614
|
Google Pixel 3
|
235
|
Google Pixel 2
|
350
|
Samsung Galaxy J2 Pro
|
75
|
Samsung Galaxy J5 Pro
|
240
|
Samsung Galaxy J6 Dual Sim
|
155
|
Samsung Galaxy JS9
|
575
|
HTC U11 4G 64 GB
|
255
|
LG Q7
|
150
|
Sony Xperia XA2 Ultra
|
210
|
HAUWEI Nova 3E
|
190
|
quantities
The quantities array is a list of strings as follows:-
2,5,8,19,12,15,20
shops
the shops array is a list of strings as follows:-
Preston, Coburg,, Epping, Broadmeadows, Northcote, Collingwood, City, Prahran, St.Kilda, Brighton.
You will need to
1. Create the class with he attributes as above
2. Create the getters and setters
3. Create a separate test class in a separate test folder that tests
i. That the fifth product in the phone array is "Google Pixel 2"
ii. The twelfth price is "210"
iii. The 3rd quantity is"8".
DBConnectivity.
In phase 1 just create an empty class. This clas will be populated in phase 3.
Phase 2
This is the most complex part it requires
Display
The following can be created with WindowBuilder.
1. Creating a separate userInterface folder and in it, creating the GUI class.
2. You will create labels for each of the required fields as perexample above.
3. The shops, phones and quantities will be JComboBoxes (as per example above)
4. The order number will go into an editable JTextField.
5. Price, value and order value will go into non-editabletextfields
6. You will have 3 buttons (addItem, save, retrieve) for which you will create actionlisteners.
7. You will have a JTable which will show the required information when you click addItem or retrieve
Items 3 to 6 above should be instance variables.
Activity.
1. Create an instance variable of the type -Products and Shopsin the class GUI and instantiate it in the constructor.
2. Use the getters of ProductsandShopsto populate arrays for price, phone and quantity in the class GUI and then use these to poupulate the ComboBoxes.
3. The user selects a shop - if there is an existing order for another shop, all the details of that order are cleared.
4. The user then types in an order number.
5. The user selects a phone from the combobox.
6. The price for that phone is selected automatically from the price array and displayed in the non-editable textbox.
7. The user selects a quantity from the quantity combobox. The quantity and price are converted to integers, the value is calculated and displayed in value textbox. The value is added to total value and displayed in the total value text box.
8. On pressing the additem button the details are shown on the Jtable.
Phase 3
Database connectivity will be discussed in later lectures.
Essentially this requires the details of the Jtable along with the order number and shop to be saved when the save button is pressed.
For retrieve, the user enters the order number, presses retrieve and the details are retrieved from the databse and displayed on the Jtable
Attachment:- Project.rar