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

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  What are the benefits of using javascript

Write a 150-word synopsis on how JavaScript is used to add functionality to a website. What are the benefits of using JavaScript for this application?

  Implement a third component of the compiler

To detect duplicate declarations using the same identifier, you call the method retrieveOneLevel. This method returns a pointer to the identifier entry if the identifier was declared before in the current scope and null otherwise.

  Creating mapreduce program to calculatingpi

Creating MapReduce program to calculatingpi, Step 1: Generate an input file to the Pi MapReduce program and Create a regular Java program which accepts two command line arguments

  Handling the unexpected in life

100-300 Words. We often are handling the unexpected in life.  Kids and pets can offer many of these unexpected occurrences. Where do you see life's every day exception and how would the programming look for those?  Humor is appreciated.

  WAP that takes integer as number of both rows and columns

Write a program ShiftNumbers.java that takes integer M as the number of both rows and columns for your 2D array. Create the same exact following 2D array.

  Create an abstract division class with fields

Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method. Use a constructor in the superclass that requires values for both fields.

  Your taskbullthe auction system should allow the user to

your taskbullthe auction system should allow the user to participate in a number of items and for the user to be able

  Describe the basic concepts and techniques of unit testing

CMSC 256 Data Structures And Object Oriented Programming Assignment - JUnit in Eclipse and Recursion Lab, Virginia Commonwealth University, USA

  Write a complete java program to calculate the total charge

Write a complete Java program to calculate the total charge corresponding to purchase of books at a fictional annual book festival.

  Why wont the following given program compile

Why won't the following program compile? Correct it so that it will compile and properly implement Comparable

  Object oriented programming

Please find four important/popular software developed by Object Oriented Programming, in particular JAVA, and explain their features and why the OOP gives them advantage.

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