Question: Tip, Tax, and Total Problem: Create a JavaFX application that lets the user enter the food charge for a meal at a restaurant. When a

Tip, Tax, and Total Problem: Create a JavaFX application that lets the user enter the food charge for a meal at a restaurant. When a button is clicked, the application should calculate and display the amount of an 18 percent tip, 7 percent sales tax, and the total of all three amounts.

I need an html file with this, I don't know how to go about doing that. This is what I have for the program and it works just fine, I just don't know how to make the html file or incorporate it into my java file. Can someone help me?

------------------------------------------------------------------------------------------------------

package WordNode;

import java.awt.Button; import java.util.Scanner;

public class TipTaxTotal {

public static void main(String [] args) { double charge; double tax = 0.07; double tipRate = 0.18; double totalWithTax; double taxAmount; double tipAmount; double grandTotal; Scanner keyboard = new Scanner(System.in); //ask for charge from the user System.out.println("What is the charge for your meal?"); charge = keyboard.nextDouble(); //calculate the charge and the tip taxAmount = charge * tax; totalWithTax = charge + taxAmount; tipAmount = totalWithTax * tipRate; grandTotal = totalWithTax + tipAmount; //Display it back to the user System.out.println("meal: $" + charge); System.out.println("tax: $" + taxAmount); System.out.println("meal + tax: $" + totalWithTax); System.out.println("total cost(tip included): $" + grandTotal); }

}

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!