mport javax.swing.JOptionPane; public class tipcalculator { /** * This program is for calculating a tip from a set amount * Written by Brandon Scott * on 1/31/07 * */ public static void main(String[] args) { String billString; billString = JOptionPane.showInputDialog(null, "Enter Bill Amount: ", "bill Input (int)", JOptionPane.QUESTION_MESSAGE); double billDouble = Double.parseDouble(billString); String gratString; gratString = JOptionPane.showInputDialog(null, "Enter Gratuity Amount: ", "grat Input (int)", JOptionPane.QUESTION_MESSAGE); double gratDouble = Double.parseDouble(gratString); double percDouble = (gratDouble/100); double total = (billDouble) + (percDouble); JOptionPane.showMessageDialog(null, "The Gratuity Rate is:" + percDouble , "perc Output", 1); JOptionPane.showMessageDialog(null, "Your Bill is:" + total , "total Output", 1); } }