Develop a Windowed GUI Java Program

Assignment Help JAVA Programming
Reference no: EM132327766

Programming Fundamentals Assignment - JAVA Program using array of objects

Details - For this assignment, you are required to develop a Windowed GUI Java Program to demonstrate you can use Java constructs including input/output via a GUI interface, Java primitive and built-in types, Java defined objects, arrays, selection and looping statements and various other Java commands. Your program must produce the correct results.

The code for the GUI interface is supplied and is available on the unit website, you must write the underlying code to implement the program. The command buttons are linked to appropriate methods in the given code. Please spend a bit of time looking at the given code to familiarise yourself with it and where you have to complete the code. You will need to write comments in the supplied code as well as your own additions.

What to submit for this assignment -

The Java source code: You will need to submit two source files: Order.java and RockyDryCleanersGUI.java, please submit these files as a single zip file. Only include your source code in the zip file you must submit your report separately.

Assignment Specification -

In assignment one we read in multiple customer names and number of garments using both Scanner and GUI dialogs. In this assignment we are going to read in the data and output the information via a GUI interface. The code for the GUI interface called RockyDryCleanersGUI.java is supplied (via the Moodle web site), this has the basic functionality of the interface and you need to use this for your program. We are also going to store the information in an array of Order objects.

Look at the code supplied and trace the execution and you will see the buttons are linked to blank methods (stubs) which you will implement the various choices via the buttons.

The GUI interface contains three JLabels for the heading and the prompts. There are two JTextFields in which the customer name and number of garments are entered. There is also a JTextArea for displaying the output.

Four JButtons are at the bottom which link to blank methods for implementing the functionality of the application.

Order class - First step is to create a class called Order (Order.java) which will not contain a main.

The Order class will be very simple which will contain two private instance variables:

  • customerName as a String
  • garments as an integer

The following public methods will have to be implemented:

  • A default constructor
  • A parameterised constructor
  • Two set methods (mutators)
  • Two get methods (accessors)
  • calculateCharge value returning method*

*You will create a public value returning method calculateCharge(), the order charges can be derived from the instance variable garments. Typically we do not store calculated values in a database so the charge will be derived via your calculateCharge() method. Do not store the charge as an instance variable.

The method will be similar to calculateCharge method from assignment one, with the same scale of pricing based on the number of garments. You can use the code from assignment one.

One to two garments: $8.50 per garment.

Three garments: $20.00.

More than three garments: $20.00 plus $6.50 per garment after that.

You should use the following method header: public double calculateCharge()

Note: you do not need to pass garments as a parameter as you can access the instance variable garments directly.

RockyDryCleanersGUI class

Once the Order class is implemented and fully tested we can now start to implement the functionality of the GUI interface.

Data structures

For this assignment we are going to store the customer names, number of garments in an array of Order objects. Do not use the ArrayList data structure.

Declare an array of order objects as an instance variable of RockyDryCleanersGUI class, the array should hold ten entries. Use a constant for the maximum entries allowed.

private Order [] orderArray = new Order[MAX_ORDERS];

We need another instance variable (integer) to keep track of the number of orders being entered and use this for the index into the array of Order objects.

private int currentOrder = 0;

Attachment:- Assignment File.rar

Verified Expert

This assignment is implemented in java programming language.It is GUI application to automate the rocky dry cleaner system.It has 2 java files order.java and rockydrycleanerGUI.java. It is object oriented programming approach based project.A customer can do any type of dry cleaning orders.At the end of the application he will get the total bill amount.

Reference no: EM132327766

Questions Cloud

Define what we mean by the scientific process : Define what we mean by the scientific process. Provide any one biological observation in your environment that can be used to support your definition
Identify each account as either an asset (a), liability : Identify each account as either an asset (A), liability (L), equity (Eq), revenue (R), or expense (Ex): a) Show the accounting equation which results from each of these transactions. b) Prepare general journal entries.
What distinguishes living organism from nonliving thing : What do all living organisms have in common? What distinguishes a living organism from a nonliving thing? How can we get life from something that isn't alive?
Who differ greatly in their communication and delivery style : For this discussion board post, you will watch two speakers who differ greatly in their communication and delivery styles.
Develop a Windowed GUI Java Program : COIT11222 - Programming Fundamentals Assignment - JAVA Program using array of objects, CQ University, Australia. Develop a Windowed GUI Java Program
Describe the steps in the process of protein synthesis : Describe the steps in the process of protein synthesis.Describe how interference in protein synthesis can result in disruption of cellular and bodily processes?
Compare and contrast biofuels and fossils fuels : Compare and contrast biofuels and fossils fuels. For example, how is corn converted into ethanol? What is the original source of energy in fossil fuels?
Light-dependent reactions of photosynthesis or calvin cycle : Describe one of the following processes: glycolysis, citric acid cycle, oxidative phosphorylation, light-dependent reactions of photosynthesis, or Calvin Cycle.
Which communicable diseases are you : Which communicable diseases are you, personally as a health care provider, the most concerned with?

Reviews

len2327766

6/25/2019 1:36:43 AM

What to submit for this assignment - The Java source code: You will need to submit two source files: Order.java and RockyDryCleanersGUI.java, please submit these files as a single zip file. Only include your source code in the zip file you must submit your report separately. Ass2.zip If you submit the source code with an incorrect name you will lose marks. A report including an UML diagram of your Order class (see text p 468 or p 493 8th edition), how long it took to create the whole program, any problems encountered and screen shots of the output produced with annotations. (Use Alt-PrtScrn to capture just the application window and you can paste it into your Word document) You should test every possibility in the program. ReportAss2.docx You will submit your files by the due date using the “Assignment 2” link on the Moodle unit website under Assessment … Assignment 2 Submission.

len2327766

6/25/2019 1:36:35 AM

Extra Hints - Your program should be well laid out, commented and uses appropriate and consistent names (camel notation) for all variables, methods and objects. Ensure you have header comments in both source files, include name, ID, filename, date and purpose of the class. Make sure you have no repeated code (even writing headings and lines in the output), you should try and write a method which accepts an error message as a parameter and displays the error message in a message dialog within the method; use JOptionPane.ERROR_MESSAGE as the last parameter in the message dialog. Constants must be used for all literal numbers in your code (calculateCharge method and maximum entries). Look at the marking criteria to ensure you have completed all of the necessary items. Refer to a Java reference textbook and the unit and lecture material (available on the unit web site) for further information about the Java programming topics required to complete this assignment. Check output, check code and add all of your comments, complete report and the UML class diagram.

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