Hello, I have been having a very hard time with this do while loop...it doesn't seem to work...it says cannot find symbol variable on the last line...can anybody help please?
thank you
System.out.print("Please tell me how many people you are in your group: ");
double numberPeople=input.nextDouble();
System.out.print("Thank you, now tell me the total cost of your meal: ");
double totalCost=input.nextDouble();
System.out.print("Thank you, now please tell me discount you were allotted in % form: ");
double discount=input.nextDouble();
//Compute the given data
do{
double worthDiscount=totalCost*(discount/100);//Calculate the total cost after the discount is given
double amountGst=worthDiscount*GST;//Calculate the amount of Pst (cost after disc.*.05)
double amountQst=(worthDiscount+amountGst)*QST;//Calculate the amount of Qst, so I did (cost after discount+Gst)*.075
double totalPayableAmount=worthDiscount+amountGst+amountQst;
double amountPaidByEach=totalPayableAmount/numberPeople;
//Output the results to console
System.out.println("Your discount is "+discount+"%, which comes up to "+worthDiscount+"$.");
System.out.println("Your subtotal price after discount is "+(totalCost-worthDiscount));
System.out.println("You are "+numberPeople+ " people");
System.out.println("The GST comes to "+amountGst+" $");
System.out.println("The Qst comes to "+amountQst+"$");
System.out.println("Your total price is "+(((totalCost-worthDiscount)*1.05)*1.075)+"$");
System.out.println("The amount paid by each person is: "+(((((totalCost-worthDiscount)*1.05)*1.075))/numberPeople)+"$");
System.out.println("Would you like to repeat the calculation?");
double answer=input.nextDouble();
}
while (answer=1);
}