This commit is contained in:
xixu-me committed 2024-04-23 00:29:08 +08:00
1 parent 4b00d5838c
commit a31c9233d0
3 files changed
+96 -4

No files matched your search

+4 -1
View File
@@ -10,6 +10,9 @@ public class Test {
boolean continueBuy = true;
Scanner sc = new Scanner(System.in);
while (continueBuy) {
System.out.println("Ticket Seller: Five Yuan - " + ts.getFive() + ", Ten Yuan - " + ts.getTen()
+ ", Twenty Yuan - " + ts.getTwenty() + ", Fifty Yuan - " + ts.getFifty() + ", Hundred Yuan - "
+ ts.getHundred());
System.out.print("Please enter your name: ");
name = sc.nextLine();
System.out.print("Please enter your payment: ");
@@ -17,7 +20,7 @@ public class Test {
Thread consumer = new Thread(ts, name + "-" + payment);
consumer.start();
try {
consumer.join();
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}