Ticket Producing Function?

Please I need help making a function that after a user inputs his/her desired seat row and column it will produce a random ticket number that later if you input it again it will show the rows and the columns of the SEATSSS the user inputed.

I'm really a noob , so please talk in a very detailed manner.... thanks in advance

here is my code so far
it's not done yet.. so it in self is still wrong
but i really need help figuring out the ticket func.
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#include<iostream>
#include<cstdlib>
using namespace std;
void showSeats(int, int);
char res[25][8];
int i,j;
int seat_row[25], seat[8];
void showSeatsZ(int, int);
char res2[25][8];
int i2,j2;
int seat_row2[25], seat2[8];
int main()
{
	int loop1, checker1;
	checker1=1;
	int choice,c2;
	int first_seatrow, first_seat;
	int k = 1;
	int choices=0;
	int row0,row1=0,row2=0,row7,row8;
	int class_choices=0;
	for(i=0;i<25;i++)
    for(j=0;j<8;j++)
        res[i][j]='O';
	cout<<"^^^^^PICK A CINEMA^^^^^\n"
		<<"[1]Cinema 1\n"
		<<"[2]Cinema 2\n"
		<<"^^^^^^^^^^^^^^^^^^^^^^^\n"
		<<"Enter Here:";
		cin>>choice;
		switch(choice)
{
		case 1:
				system("cls");
	cout<<"^*^*^*^*^*C H O O S E O N E^*^*^*^*^*\n"
		<<"*************************************\n"
		<<"**>>FAST AND THE FURIOUS 6 MOVIE<<***\n"
		<<"*************************************\n"
		<<"[1]Check Seat via Ticket\n"
		<<"[2]View Available Seats\n"
		<<"[3]Reserve Seats\n"
		<<"[4]Buy Tickets\n"
		<<"[5]Return to original menu\n"
		<<"*************************************\n"
		<<"Enter Here:";	
		cin>>c2;
			switch(c2)
			{
			
				case 1:
				break;
				case 2:
				showSeats(seat_row[k],seat[k]);
				break;
				case 3:
		cout<<endl<<"\tA\t B\t C\t D\t E\t F\t G\t H\t I\t"<<endl;
                for(i=0;i<25;i++)
        
            {
                cout<<"Row "<<i+1;
                for(j=0;j<8;j++)
                {
                    cout<<"\t"<<res[i][j];
                }
                cout<<endl;
            }
            cout<<endl<<"O - Available Seats";
            cout<<endl<<"X - Occupied Seats";
            cout<<"\nHow many seats would you like to reserve?: ";
            cin>>loop1;
            checker1=1;
            do{
           
		    cout<<endl<<"Enter your desired row : Row ";
            cin>>seat_row[k];
             cout<<endl<<"Enter your desired seat number (1-8) :";
             cin>>seat[k];

            if(res[seat_row[k]-1][seat[k]-1]!='X')
            {
                res[seat_row[k]-1][seat[k]-1]='X';
                cout<<endl<<"Reserved\n";
                checker1++;
            }
            else
            {
                cout<<endl<<" Seat is taken.";
                
    
            }
            
            	}while(checker1<=loop1);
			
            system("pause");
            break;
		
				break;
				case 4:
				break;
				case 5:
				break;
			}//end case1 switch
	             break;
			
		case 2:
			int first_seatrow2, first_seat2;
			int k2 = 1;
			int choices2=0;
			int row20,row21=0,row22=0,row27,row28;
			int class_choices2=0;
			for(i2=0;i2<25;i2++)
    		for(j2=0;j2<8;j2++)
        	res2[i2][j2]='O';
			system("cls");
	cout<<"^*^*^*^*^*C H O O S E O N E^*^*^*^*^*\n"
		<<"*************************************\n"
		<<"*********>>CATCHING FIRE<<***********\n"
		<<"*************************************\n"
		<<"[1]Check Seat via Ticket\n"
		<<"[2]View Available Seats\n"
		<<"[3]Reserve Seats\n"
		<<"[4]Buy Tickets\n"
		<<"[5]Return to original menu\n"
		<<"*************************************\n"
		<<"Enter Here:";	
		cin>>c2;
			switch(c2)
			{
			
				case 1:
				break;
				case 2:
					   	         showSeatsZ(seat_row2[k2],seat2[k2]);
				break;

			case 3:
		cout<<endl<<"\tA\t B\t C\t D\t E\t F\t G\t H\t I\t"<<endl;
            for(i2=0;i2<25;i2++)
            {
                cout<<"Row "<<i2+1;
                for(j2=0;j2<8;j2++)
                {
                    cout<<"\t"<<res2[i2][j2];
                }
                cout<<endl;
            }

          
            cout<<endl<<"O - Available Seats";
            cout<<endl<<"X - Occupied Seats";     
            cout<<endl<<"Enter your desired row : Row ";
            cin>>seat_row2[k2];
            if(res2[seat_row2[k2]-1][seat2[k2]-1]!='X')
            {
                res2[seat_row2[k2]-1][seat2[k2]-1]='X';
                cout<<endl<<"Reserved\n";
            }
            else
            {
                cout<<endl<<" Seat is taken.";
                break;
            }
            system("pause");
				break;
			case 4:
				break;
			case 5:
				break;
	}//end case2 switch
	break;
	
	}//end switch

}//end main
void showSeats(int a, int b)
{
	
	
	cout<<endl<<"\tA\t B\t C\t D\t E\t F\t G\t H\t"<<endl;
            for(i=0;i<25;i++)
            {
                cout<<"Row "<<i+1;
                for(j=0;j<8;j++)
                {
                    cout<<"\t"<<res[i][j];
                }
                cout<<endl;
            }
}//seat display

	void showSeatsZ(int a2, int b2)
{
	
	
	cout<<endl<<"\tA\t B\t C\t D\t E\t F\t G\t H\t"<<endl;
            for(i2=0;i2<25;i2++)
            {
                cout<<"Row "<<i2+1;
                for(j2=0;j2<8;j2++)
                {
                    cout<<"\t"<<res2[i2][j2];
                }
                cout<<endl;
            }
}
Topic archived. No new replies allowed.