Эта программа работала, пока я не удалил некоторые комментарии.
Теперь, когда я запустил его и введите число в диалоговом окне.возвращается только "charged: "
.
import javax.swing.JOptionPane;
/**
* This program will calculate tip, tax, total cost
*
* @author Nathan
* @version 20180922
*/
public class Tipping
{
public static void main(String[] args){
double charge,tax,tip, total;
String chargeS;
chargeS = JOptionPane.showInputDialog ("Enter purchase amount ");
charge = Double.parseDouble(chargeS);
tax = charge * .07;
tip = charge * .18;
total = charge + tax + tip;
System.out.printf("charged: %.2f \ntax is: %.2f \ntip is: %.2f \ntotal is: %.2f",charge, tax, tip, total);
System.exit(0);
}
}