Create an instance variable of the type

Assignment Help JAVA Programming
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

1268_figure.jpg

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

Reference no: EM132307941

Questions Cloud

Job analysis is key component of strategic staffing process : Job analysis is a key component of the strategic staffing process. What methods of job analysis are available?
Describe the impact of musical minimalism on film music : Describe the impact of musical minimalism on film music in the 21st century. Be sure to include the concept of action minimalism and to cite specific films.
Define employment parity and occupational parity : Define employment parity, occupational parity, systemic discrimination, under utilization, and concentration.
Determine how to improve your skill in the given areas : After reading chapter 5 of the textbook, complete this activity. You have learned about the skill of understanding and managing diversity.
Create an instance variable of the type : Create an instance variable of the type - Products and Shopsin the class GUI and instantiate it in the constructor - creating the model classes and junit tests
Discuss how caesar took over gaul : Discuss how Caesar took over Gaul (be specific). How did he enhance his image and prestige in doing so? What were the positive consequences of his conquest?
Explain the structure of the logistics process : Explain the structure of the logistics process in the United States. Explain the following passage concerning the contents of the Perez-Reverte book.
Why you believe that you are either college or career ready : The goal of every high school is to graduate students ready for the future whether the student chooses to continue his/her education or immediately enter.
Evaluate the structure of the global wine industry : Evaluate the structure of the global wine industry. How and why is that structure changing? How do these changes present threats for Robert Mondavi?

Reviews

len2307941

5/17/2019 2:14:26 AM

User Interface (18 marks) All user interface classes properly constructed with appropriate fields for input and display Fields are populate from the model as required Price, quantity, value and total value respond appropriately to use selection JTable responds appropriately when addItem button pressed User interface code in separate folder from domain model and junit code User interface allows for clearing of data Total this section 2 4 4 5 1 2 18

len2307941

5/17/2019 2:14:15 AM

Major Project –Phone Application MARK Phase 1 – setting up initial prototype (8 marks) All domain classes constructed with required attributes All getters and setters constructed All junit tests constructed and working Junit code in separate folder from domain model Total this section 1 2 4 1 8

len2307941

5/17/2019 2:14:08 AM

A word report should be attached (half to 1 page) discussing the design of the program and any issues that arose in writing the program. • Phase 3 making the database aspects operational (8 marks) 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.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd