title: Need to add user confirmation and a running total to simple ticketing system
body: <p>I've got to complete a current assignment that I've been making some changes to and I am stuck on what I hope will be my last problem before submission</p>
  
  <p>I need to create a simple ticketing system for a cinema, and I have been able to create (with the help of other experienced developers) a working system. However, the ticketing system needs to prompt the user for confirmation to continue the method, and to show a current total cost. The confirmation needs to be the user entering the number 1, if not, to output an error message.</p>
  
  <p>I've attempted using the <code>again = br.readLine();</code> to output the 1 to confirm the purchase, I have also tried importing the <code>java.util.Scanner</code> class to then input and use <code>int</code> to create an error message but it continues to show errors. </p>
  
  <pre><code> package ticketingsystem;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  
  public class ticketingsystem {
  
      enum TicketType {
  // I chose to use the enum class for the ticket prices, //
  // as it made it much easier to use a switch statement, instead of multiple if statements. //        
          CHILD(18), ADULT(36), SENIOR(32.5);
  //Enum classes are needed to be used in upper case, otherwise the program will crash//
  //as I discovered//        
          TicketType(double price) {
              this.price = price;
          }
  
          private double price;
  
          public double getPrice() {
              return price;
          }
      }
  
      public static void main(String[] args) throws IOException {
  
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          //As the program needed the ability to run in an indefinite loop constantly adding //
          //calculations, I chose to use buffered reader, as it buffered the method each loop//
          //continuing to add a total number.//
  
          String type, again;
          int quantity = 0;
          // This is where the new calculation starts, it is set at 0 before being calculated and
          //added to the total price.//
          double totalPrice = 0;
          TicketType ticketType;
          //We link the TicketType calculations to the enum class, hence//
          // TicketType ticketType.//
  
          System.out.println("Welcome to the cinemas!");
  
          System.out.println("MAIN MENU\n");
          System.out.println("Cinema has the following ticketing options\n");
          System.out.println("1 = Child (4-5 yrs)");
          System.out.println("2 = Adult (18+ yrs)");
          System.out.println("3 = Senior (60+ yrs)");
  
          do {
              //Our loop calculation method starts here//
              System.out.print("\nEnter your option: ");
  
              type = br.readLine();
  
              switch (type.toLowerCase()) {
                  case "1":
                      ticketType = TicketType.CHILD;
                      break;
  
                  case "2":
                      ticketType = TicketType.ADULT;
                      break;
  
                  default:
                      ticketType = TicketType.SENIOR;
                      break;
              }
  
              System.out.print("Enter total No of tickets: ");
  
              quantity = Integer.parseInt(br.readLine());
  
              totalPrice += ticketType.getPrice() * quantity;
              //totalPrice is the ticketType cost (hence the += operator), times//
              //the quantity.//
              System.out.printf("--&gt; You are purchasing %s - %s Ticket(s) at $%s\n", quantity, ticketType, ticketType.getPrice());
              System.out.println("Press 1 to confirm purchase");
  
              //This is where we confirm the purchase//
              // This is where the current total cost needs to be output //
              System.out.print("\nDo you wish to continue?  (Y/N) : ");
  
              again = br.readLine();
  
          } while (again.equalsIgnoreCase("y"));
          //This is where the calculation method ends (as we are using a do/while loop).//
          // The while statement means that if we type "y", the loop will begin again with a buffer.//
          //If we type N, the loop will end, and the program will continue running past the loop.//
          System.out.printf("\n==&gt; Total Price : $%s \n", totalPrice);
      }
  }
  </code></pre>