Question: Create a tip calculator application as follows: Start with an order class with two instance variables, item and price; include two constructors, a no-parameter constructor

Create a tip calculator application as follows: Start with an order class with two instance variables, item and price; include two constructors, a no-parameter constructor that passes default value empty string and zero(0) to the second constructor that calls the set methods for item and price; the set method for price validates that price is greater than zero(0); include get methods for both instance variables; there is no need for a toString() method. Instantiate 10 objects from the Order class in the start() method of the JavaFX application from which two ObervableList should be instantiated:(a) an ObservableList of Strings populated from the get method for the "item" field; and (b) an ObservableList of Integers (use the wrapper class as the subtype to instantiate) populated from the get method for the "price" field. The JavaFX form will consist of (a) a ListView of Strings from the ObservableList populated from the get methods of the orders object; (b) a Slider that represents tip percentage as in int between 15% and 25% (show the current value of the "tip percent" slider in a matching Label); (c) a Button that is clicked to calculate the "total bill"; and (d) a "result" Label. Include an event handler method for the Button that calculates the "total bill" as follows: the "price" field "item" from the ObservableList that matches the selected "item" from the ListView times sales tax (8.625%) plus the tip which is the matching "price" from the ObservableList times the percentage from the Slider; display with text labels in the "result" Label the selected "item", its matching "price", the sales tax, the amount of the "tip" and the "total bill"

Program: NetBeans

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!