Hello everyone! Having a bit of trouble with the math on this one. When I run the program it doesn't read the gratuity as a percentage, which is why it's showing up as a whole number. I need this program to basically output the tip amount by itself, and then the grand total. Of course allowing the user to input whatever the rate of gratuity is. Any help/advice is appreciated!
package calculatingtip; import java.util.Scanner; public class CalculatingTip { public static void main(String[] args) { Scanner input=new Scanner(System.in); double billBeforeTip; double tipRate; double tipAmount; double grandTotal; System.out.println("Enter Bill Amount"); billBeforeTip = input.nextDouble(); System.out.println("Enter Rate of Gratuity"); tipRate = input.nextDouble(); System.out.println("The Amount before the tip is: " + billBeforeTip + " The Gratuity rate is " + tipRate + "%"); tipAmount = billBeforeTip * tipRate; grandTotal = tipAmount + billBeforeTip; System.out.println("The Grand Total comes to " + grandTotal + "The Gratuity is: " + tipAmount); } }