Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Our Tip Calculator app has been very successful, but you have received a request for a modification. Some restaurants add a minimum tip amount to

Our Tip Calculator app has been very successful, but you have received a request for a modification. Some restaurants add a minimum tip amount to the bill, then leave room for an additional tip. Users have requested that you provide a way to enter the billed tip amount and then have the app give you the additional tip amount and the total amount of the bill. The GUIs for the current app and the proposed modification are as follows:

  • Begin by creating a new Project (do NOT select new Java Project):
    • In Select a wizard: choose JavaFX Project under JavaFX, click Next
    • In New Java Project, Create a Java Project: Name your project MyGradedExercise3_1, click Next
    • In New Java Project, Java Settings: Click Next
    • In New Java Project:
      • Select FXML in the Language dropdown box
      • Set Root-Type to javafx.scene.layout.GridPane
      • Set the File Name to MyTipCalculator
      • Set the Controller Name to MyTipCalculatorController
      • Click Finish [note: this step may take a few seconds]
  • In the Package Explorer:
    • Expand MyGradedExercise3_1
    • Expand the src folder
    • Expand the application package
    • Open Main.java, MyTipCalculatorController, and MyTipCalculator.fxml by double-clicking on them
  • Do not forget you will need to open Window-Preferences in Eclipse, select JavaFX, and tell it where the SceneBuilder.exe file is located.
  • How you proceed from here is up to you. There are two main options:
    1. Follow the directions in your book to create the TipCalculator app. Keep in mind that the directions in the book are for NetBeans, so you will need to do a few things differently in Eclipse.
    2. Open the textbook TipCalculator files, then copy-and-paste them into your project. Keep in mind that the book has a TipCalculator.java file with a TipCalculator class, we have a Main.java file with a Main class. Our controller and FXML files have different names too.
      • When you copy the TipCalculator.java code into Main.java you will need to:
        • Keep the package application; statement
        • Rename the class from TipCalculator to Main
        • Change the .getResource statement so that it is looking for the file MyTipCalculator.fxml
      • When you copy the TipCalculatorController.java code into MyTipCalculatorController.java you will need to keep the package statement and change the name of the class to MyTipCalculatorController
      • When you copy the TipCalculator.fxml code into MyTipCalculator.fxml you will need to change the controller name from TipCalculatorController to package.MyTipCalculatorController
  • When you have the TipCalculator app from the textbook up & running you are ready to move on to the next step.

Sample Output

Example 1: The Purchase Amount is $100.00, the Billed Tip Amount is $0.00, and the user wants to leave a 15% tip. When the user presses Calculate the Additional Tip would become $15.00 and the Total would become $115.00.

Example 2: The Purchase Amount is $100.00, the Billed Tip Amount is $10.00, and the user wants to leave a 15% tip. When the user presses Calculate the Additional Tip would become $5.00 and the Total would become $115.00.

Example 3: The Purchase Amount is $100.00, the Billed Tip Amount is $10.00, and the user wants to leave a 5% tip. When the user presses Calculate the Additional Tip would become $0.00, the Total would become $110.00, the tip label would become Minimum 10%, and the tip slider would be set to 10%.

image text in transcribed

Tip Calculator 3 Tip Calculator 3 Tip Calculator Purchase Amount 100.00 Purchase Amount 100.00 Purchase Amount 100.00 Billed Tip Amount 000 Billed Tip Amount 10.00 Billed Tip Amount 10.00 15% 15% Minimum 10% Additional Tip $15.00 Additional Tip $5.00 Additional Tip $0.00 Total $115.00 Total $115.00 Total $110.00 Calculate Calculate Calculate Example1 Example 2 Example3

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

'a

Answered: 1 week ago

Question

13-6 How will MIS help my career?

Answered: 1 week ago