Write a program that will ask the user for the number of adult tickets, the number of children’s tickets, whether they want reserve or general admission, and whether they have a radio voucher to use. Calculate the cost of the order.
There are two levels of tickets, Reserved for $55.00 each or General Admissions at $35.00 each. Kids under 12 are half off. The local radio station is running a special. If you call in, they will send you a voucher that will give you a 20% discount.
All orders over $200 get a 10% discount on the final price (after other discounts are applied) and those over $400 get 15% off.
My code so far...
public static void main(String[] args) {
// variables
int adultTix;
int childTix;
int GENERAL_ADMISSION = 35;
int RESERVED = 55;
double radioDiscount = .20;
double ticketTotal = 0;
Scanner scan = new Scanner(System.in);
System.out.println("How many adult tickets?");
adultTix = scan.nextInt();
System.out.println("How many kids tickets?");
childTix = scan.nextInt();
scan.nextLine();
System.out.println("Reserved tickets are $55 each and General Admission is $35."
+ " Would you like Reserved or General Admission? (enter GA or RE only):");
String tixType = scan.nextLine();
if (tixType == "GA" || tixType == "ga")
ticketTotal = ((adultTix * GENERAL_ADMISSION) + ((childTix * GENERAL_ADMISSION) / 2));
else if (tixType == "RE" || tixType == "re")
ticketTotal = ((adultTix * RESERVED) + ((childTix * RESERVED) / 2));
System.out.println("Do you have a radio voucher? (enter yes or no):");
String radioQ = scan.nextLine();
if (radioQ == "yes")
System.out.print("With the radio discount, you will save 20%!");
if (radioQ == "no")
System.out.println("No radio discount.");
double radioT;
radioT = ((ticketTotal - (ticketTotal * radioDiscount)));
if (radioT >= 200 && radioT < 400)
System.out.println("With a 10% discount, your total is: $"
+ (radioT * .9));
else if (radioT > 400)
System.out.println("With a 15% discount, your total is: $"
+ (radioT * .85));
scan.close();
}
}
Asks all of the questions correctly but doesn't return an output. This is a simple Java program so I would like the simplest answer possible