Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a new JavaFX project called Part3 in NetBeans. Imagine you are writing an app for a shop to allow the staff to enter orders

Create a new JavaFX project called Part3 in NetBeans.

Imagine you are writing an app for a shop to allow the staff to enter orders for the customers. When the user is finished the data will be written to an Order object (see attached class at the end of this assignment) and then the Order object will be added to an ArrayList so that it can be stored. The user can then enter data for a new Order and repeat the process. 3 Your app will need the following UI controls that will be mapped to instance variables in the Order Class provided at the end of this document:

Text field for the first name

Text field for the last name

Slider for the number of pies

Radio buttons for at least 4 pie types (APPLE, CUSTARD ETC)

A combo box for at least 4 sizes (small, medium etc)

Check boxes for at least 4 PIE extras (strawberry,mango,berries etc)

A list view for at least 4 side orders of food (cake, muffin etc)

Please note that if the user enters an order for more than 1 pie, all of the pies in an order will be of the same type. Once a user has entered the data for an Order your app needs to do the following: Write the data from the UI to an Order object (use the attached class at the end of this assignment) Add the Order object to a ArrayList that will store all Orders entered by the app Reset the UI controls so the user can enter a new Order One way to do this would be to have the following (you do not have to do it this way): A New Order button that resets the UI controls. An Add Order button that creates a new instance of the Order, sets the Orders instance variables (via the mutator methods) using the values from the UI controls and then adds the Order to the ArrayList PLEASE NOTE: Marks will be given for cohesion i.e. you should not have all of your code in the start method. Your program should make use of multiple methods, each with a distinct function You CANNOT modify the attached Order class

Use the following class for your Order:

public class Order { // text field private String firstName; // text field private String lastName; // slider private Integer numberOfPies; // radio buttons private String pieType; // combo box private String pieSize; // check boxes private HashSet extras = new HashSet(); // list view private HashSet sideOrder = new HashSet(); public Order() { } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Integer getNumberOfPies() { return numberOfPies; } public void setNumberOfPies(Integer numberOfPies) { this.numberOfPies = numberOfPies; } 5 public String getPieType() { return pieType; } public void setPieType(String pieType) { this.pieType = pieType; } public String getPieSize() { return pieSize; } public void setPieSize(String pieSize) { this.pieSize = pieSize; } public HashSet getExtras() { return extras; } public void setExtras(HashSet extras) { this.extras = extras; } public HashSet getSideOrder() { return sideOrder; } public void setSideOrder(HashSet sideOrder) { this.sideOrder = sideOrder; } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions