-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicketD.java
More file actions
41 lines (33 loc) · 1.29 KB
/
Copy pathTicketD.java
File metadata and controls
41 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
public class TicketD {
public static void main(String[] args) {
//Declaration
Scanner Sr = new Scanner(System.in);
//5 variable to store customers Ticket
String[] YourTicket = new String[5];
YourTicket[0]= "This is the 1st Ticket";
YourTicket[1]= "This is the 2nd Ticket";
YourTicket[2]= "This is the 3rd Ticket";
YourTicket[3]= "This is the 4th Ticket";
YourTicket[4]= "This is the 5th Ticket\n";
System.out.println(YourTicket[0]);
System.out.println(YourTicket[1]);
System.out.println(YourTicket[2]);
System.out.println(YourTicket[3]);
System.out.println(YourTicket[4]);
//updated for tickets 2 & 5
YourTicket[1]= "This is the UPDATED Ticket 2nd";
System.out.println(YourTicket[1]);
YourTicket[4]= "This is the UPDATED Ticket 5th";
System.out.println(YourTicket[4]);
//Deleted ticket 1
YourTicket[0]= " ";
System.out.println(YourTicket[0]);
System.out.println(YourTicket[0]);
System.out.println(YourTicket[1]);
System.out.println(YourTicket[2]);
System.out.println(YourTicket[3]);
System.out.println(YourTicket[4]);
//this program without loops
}
}