import javax.swing.*; public class Lab7_Chorus { public static void main(String[] args) { //Input the birthday person's name String name = JOptionPane.showInputDialog(null, "Whose Birthday Is It?"); //Compose a Happy Birthday chorus String chorus =happyBirthday(name); do { //"Sing" a Happy Birthday chorus JOptionPane.showMessageDialog(null, chorus); //Prompt the user whether to "sing" another chorus int answer = JOptionPane.showConfirmDialog(null, "Another chorous?", "HAPPY BIRTHDAY", JOptionPane.YES_NO_OPTION ); } while ( false ); } //Compose the Happy Birthday chorus with a given name private static String happyBirthday(String name) { return "Happy Birthday to you!" + "\n" + "Happy Birthday to you!" + "\n" + "Happy Birthday dear " + name + "!\n" + "Happy Birthday to you!"; } }