import javax.swing.JOptionPane; public class CarlysEventPriceWithMethods { public static void main(String args []) { returnGuests(); displayMotto(); displayMath(); } public static int returnGuests() { int guestsString; guestsString = JOptionPane.showInputDialog(null, "Enter the number of guests: ", JOptionPane.INFORMATION_MESSAGE); return guestsString; } public static void displayMotto() { JOptionPane.showMessageDialog(null, "\n*************************************************" + "\n*Carly's makes the food that makes it a party.*" + "\n*************************************************"); } public static void displayMath() { final int PER_PERSON = 35; double cost; int selection; boolean isYes; cost = Double.parseDouble(guestsString) * PER_PERSON; JOptionPane.showMessageDialog(null, "The number of guests: " + guestsString + "\nThe price per guest is $" + PER_PERSON + "\nThe total cost: $" + cost); selection = JOptionPane.showConfirmDialog(null, "Will the event have 50 or more guests?"); isYes = (selection == JOptionPane.YES_OPTION); JOptionPane.showMessageDialog(null, "You responded " + isYes + "\nThis is a large event!"); } }