logo
Tags down

shadow

Simple java ticketing system in netbeans


By : Lezhi
Date : October 18 2020, 06:10 AM
it should still fix some issue Hi would suggest to make the following changes.
First rename price2 to totalPrice and change it to a double:
code :
enum TicketType {
  child(18), adult(36), senior(32.5);

  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));
    String order, again;
    int quantity = 0;
    double totalPrice;
    TicketType ticketType; // add the enum to the method

    System.out.println("  ");

    System.out.println("Welcome to the cinemas!");

    System.out.println(" ");
    System.out.println("MAIN MENU");
    System.out.println(" ");
    System.out.println("The cinema has the following options");
    System.out.println(" ");
    System.out.println("1 = Child (4-5 yrs)");
    System.out.println("2 = Adult (18+ yrs)");
    System.out.println("3 = Senior (60+ yrs)");

    do {
      System.out.println(" ");
      System.out.print("Enter your option: ");
      order = br.readLine();

      //use a switch case instead of the if else pattern
      switch (order.toLowerCase()) {
        case "1":
          ticketType = TicketType.child;
          break;

        case "3":
          ticketType = TicketType.senior;
          break;

        default:
          ticketType = TicketType.adult;
          break;
      }

      System.out.print("Enter the number of tickets: ");
      quantity = Integer.parseInt(br.readLine());

      totalPrice += ticketType.getPrice() * quantity;
      // %s will be replaced with the string value of ticketType, %.2f means it will be replaced with a decimal, round to decimals 
      System.out.printf("You are purchasing %s tickets at %.2f \n", ticketType, ticketType.getPrice());

      System.out.print("Do you wish to continue?  (Y/N) : ");
      again = br.readLine(); 
    }
    while (again.equalsIgnoreCase("y"));

    System.out.println(" ");
    System.out.printf("Total Price           : $%.2f \n", totalPrice);
  }


Share : facebook icon twitter icon

PHP ticketing system + vBulletin


By : Doug Hemminger
Date : March 29 2020, 07:55 AM
wish of those help I have read some stuff in the past about OTRS, might look into that. Also a quick Google search found these:
OSTicket SimpleTicket

Ticketing system with PHP


By : Stephon James
Date : March 29 2020, 07:55 AM
I hope this helps you . First get your output after the filename and then you decode your content with base64, because as you see in the header: Content-Transfer-Encoding: base64:
code :
file_put_contents('something.zip', base64_decode($output));

time between same id ticketing system


By : Zain
Date : March 29 2020, 07:55 AM
this will help This query would check the difference between the last date and lowest date, do you want this or the difference between the last date and the second last date
code :
SELECT ticket_id, 
DATEDIFF(MAX(TIME_CREATED),MIN(TIME_CREATED)) AS DiffDate 
FROM TABLE1 
    group by ticket_id
SELECT ticket_id, TIMEDIFF(MAX(A.TIME_CREATED),

             (SELECT MAX(TIME_CREATED) FROM TICKETS B 
              where B.TIME_CREATED <MAX(A.TIME_CREATED)))  AS DiffDate 
    FROM TICKETS A
        group by ticket_id

QR Code/PHP Ticketing System


By : Don Whizz
Date : March 29 2020, 07:55 AM
Any of those help save your tickets into a table an use their id to make urls and check if they're valid.
you can also save the person who has the ticket, date range, used date, how many times can be used and ....

Need to add user confirmation and a running total to simple ticketing system


By : user2778776
Date : March 29 2020, 07:55 AM
I hope this helps . If you want the user to have to press 1 to accept purchase, then just put in a simple if...else after asking that question. Something like:
code :
String confirmation = br.readLine();
if (confirmation.equals("1")) {
    totalPrice += ticketType.getPrice() * quantity;
    System.out.println("Current total is: " + totalPrice);
} else {
    System.out.println("You did not press 1 so ticket purchase cancelled");
    System.out.println("Current cost is still: " + totalPrice);
}
Related Posts Related Posts :
  • How do I find one String inside of another
  • How to instantiate interface in Kotlin?
  • Java Intern pool implementation creates too many temporary objects
  • I need some advide about user type with hashmap
  • Is there a way to split for loop in java to do different things for values?
  • Thread safety on block of code which has external reference
  • I am unable to install java8 on my ubuntu gcp machine
  • Function returning blank string
  • Class Random Java: The method "roll()" is undefined for type Random. Why?
  • How to return value from the function without exiting from the function?
  • Getting wrong hours when Convert date without time to Milliseconds using SimpleDateFormat
  • Why we need Action Interface when all actions can be done with ActionsClass
  • How can I make this program run when it says could not find or load main class?
  • How to avoid duplicate node?
  • Everytime i run this recrusion algorithm, my variable is set to 0 how to solve it
  • Determine Whether JLabel Text is Being Cut Off?
  • Why is TomEE not able to create JMS connection factory resource?
  • Unable to sendKeys in an EditText field
  • Merge sort implementation in java is copying a value into another index instead of swapping
  • Should method parameters be made as final in Java8
  • AEM OSGI 3rd party dependency, bundle not Active
  • Using mybatis to map multiple tables to a single collection
  • Is it possible to pass text from edittext to webview?
  • Problems with repeat use of while loop
  • Change border color on click Java
  • Cannot find any information on property [bankOffer] in a bean of type [game.Game]
  • How to check if a button is clicked in another Jframe
  • IDEA Gives warning 'some variable always false'?
  • Using methods of classes that its didn't extends the same parent class
  • How do I set up a build-script with Maven?
  • How do I add arrays to an Arraylist of Arrays (Arraylist<Integer[]>)
  • Trying to remove a tuple using a prepared statement
  • Best/recommended way to convert Java 8 OffsetDateTime to localized string on android
  • Print a String n times using recursion
  • I have a Jtable with a button in one of the columns and I want to access the value in the 1st column when I press the bu
  • Generating source code with a gradle task based on existing classes with annotations on them
  • a subclass for specifying a generic shows bound mismatch
  • Static Variable with null reference
  • painting string in the middle of a given size cell java
  • Displaying column in tableView
  • What does <+ mean in Java?
  • What cplex function I have to use to write this variable?
  • Java ConcurrentHashSet - iterating over it in a multi-threaded environment
  • Can't seem to get my Java to work in VS Code
  • I don't understand the function of "count++"
  • What are the possibilities to design an API that needs overloads depending on a generic type?
  • Can't connect to Apache Ignite Cluster on AWS EC2 - Ignite server rejects clients
  • Trying to understand garbage collection in java
  • Is there a way to associate an ArrayList with another ArrayList with a one to many relationship?
  • Generate List with Combination of Subset of List, Java
  • Getting Illegal State Exception in Regex
  • Shuffling an Array (Java)
  • Tomcat v 9.0 - Public Key Retrieval is not allowed
  • Clarification on why this code is resulting in false and not true
  • Adding a log function to the java calculator program
  • Any elegant way to parse camel-style string to upper case enum in java?
  • how to download a csv file written in local computer using java
  • JCR SQL2 query: binding of ISDESCENDANTNODE param
  • Difference between db.isopen and db != null
  • How to consume the inconsistent json structure for the same key using jackson (com.fasterxml.jackson)?
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk