*NOTE: ONLY NEED THE 2-DIMENSIONAL ARRAYS MATH FIGURED OUT. OVERALL SETUP ALREAD
ID: 3695607 • Letter: #
Question
*NOTE: ONLY NEED THE 2-DIMENSIONAL ARRAYS MATH FIGURED OUT. OVERALL SETUP ALREADY IMPLIMENTED.
Pizza App – Programming Assignment
For this assignment you are going to implement a JavaFX program that allows customers to order a pizza at Ralph’s Pizza. You need to read the array chapter in your text before doing this assignment. In particular, note that our look-up tables are implemented as 2-dimensional arrays.
The opening screen for the app is shown below.
The default state for the app is a small, thin-crust pizza with no toppings. The price of a pizza depends on the chosen size, type of crust and toppings. The prices for these options are given in the two tables below. In a user-defined method, your program should implement these two tables as multi-dimensional arrays. Your method should then compute the price of the pizza based on look-ups into these tables.
Price Table for Plain Cheese Pizza
Small
Medium
Large
Thin
5.85
8.75
12.00
Thick
6.50
9.75
12.75
Deep Dish
8.00
11.00
13.75
Price Table for Toppings
Small
Medium
Large
Meat
1.25
1.75
2.25
Veggies
0.50
0.75
1.00
Here is what the app looks like for a customer who ordered a medium deep-dish pizza with sausage, mushrooms and peppers. The customer first makes choices and then presses the Finish button. Your program then displays the price of the pizza.
The Clear button resets the app to its original state.
You need to thoroughly test your program by computing the price for a number of test cases. I will run your program with a number of different options. Programs that do not compute the correct price do not meet specifications. When I grade this program I will also look at how you created the user-interface and how you defined the procedure for calculating the price. Programs that do not have a user-defined method that uses look-up tables to determine the price, do not meet specifications.
Small
Medium
Large
Thin
5.85
8.75
12.00
Thick
6.50
9.75
12.75
Deep Dish
8.00
11.00
13.75
Ralph's Pizza Ralph's Pizza App Size Small Medium Large Crust Thin Thick Deep Dish Toppings Sausage Pepperoni Salami Olives Mushrooms Peppers Finish Clear PriceExplanation / Answer
import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.stage.Stage; //from ww w. ja va 2 s. co m public class Main extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Tooltip Sample"); stage.setWidth(300); stage.setHeight(150); final CheckBox cb = new CheckBox("checkBox"); final Tooltip tooltip = new Tooltip("$ tooltip"); tooltip.setFont(new Font("Arial", 16)); cb.setTooltip(tooltip); cb.selectedProperty().addListener(new ChangeListener() { public void changed(ObservableValueRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.