Hey guys I'm new to programming (java) and I need to write a java code where a Cruise agency is offering college students to go on cruise for a week. The cruise has two different packages, standard and luxury. The standard package costs $1500 which leaves from Baltimore and the luxury package leaves from Vermont and it costs $2500 if you want to drive there or $3000 if you want to fly. Using GUI, it needs to ask for student name, ask the student if he/she would like the luxury package and if yes then it asks the student if he/she wants to drive or fly and display package selection and total amount at the end. This is what I have so far and its not working, any help would be greatly appreciated.
import javax.swing.JOptionPane; public class Cruise { public static void main(String[] args) {
int standard = 1; int luxury = 2; String name; String input; String output = ""; int userChoice = 0; boolean x = false;
do{
name = JOptionPane.showInputDialog(null, "Enter your name"); output = output + name + "\n";
}while (JOptionPane.showConfirmDialog(null, " Is" + name + "taking a luxury vacation:")==JOptionPane.YES_OPTION); output = output + name + "\n"; if( userChoice == 2) { JOptionPane.showConfirmDialog (null, "Is" + name + "flying today")=JOptionPane.YES_OPTION); } ///else if (userChoice == 2) { JOptionPane.showMessageDialog(null, "you selected the luxury package"); }