How do I use my input from 2 cases in to a 3rd case? All in one switch : So, I have been stuck with this problem for 3 hours now. My google-fu is rubbish so I haven't been able to word out my problem accurately. 


    	Scanner in = new Scanner(System.in);
		int menuSel;

		do{
			System.out.println("1. Adult Tickets");
			System.out.println("2. Child Tickets");
			System.out.println("3. Finalise Order");
			System.out.println("4. Cancel Order");
			System.out.println("Please select an option from the list:");
			menuSel = in.nextInt();
			
			switch(menuSel){
			case 1: System.out.println("Number of tickets:");
			int adult = in.nextInt(); 
			double adultTotal=(adult*15.5);
			System.out.println("Total price for " + adult + " tickets is $" + adultTotal);
			break;
			case 2: System.out.println("Number of tickets:");
			int child = in.nextInt();
			double childTotal=(child*5.75);
			System.out.println("Total price for " + child + " tickets is $" + childTotal);
			break;
			case 3: adult=?;
					child=?;			
					adultTotal=(adult*15.5);
					childTotal=(child*5.75);
				System.out.println("Your order of " + adult + "adult ticket(s) and "+ child + "child ticket(s) amounts to $" +(childTotal+adultTotal));
			}

In this code I have an issue with case 3. I cannot seem to get the variables 'adult' and 'child' to display properly. I get the "local variable may not be initialized" error. I do not want to declare variables at the main because I am inputting the values in case 1 and 2. I would like case 3 to display what I input in case 1 in case 2 as values. 

Sorry if this is a stupid question, I have been stuck at this problem for 3 hours and unfortunately I do not know how to progress further.

