About Nikolai Kolev Expertise I can answer quetions about dynamic and static structures. I can find errors in programs. I can give you ideas about solving problems.
Experience I have studied Pascal for 8 years. I'm a professional who is very experienced.
Expert: Nikolai Kolev Date: 2/7/2006 Subject: Turbo pascal v1.5 problem....
Question
I have a Pascal problem and I want you to please help me get the correct answer of it. I know that you had help all who got some Pascal problems because you have a great knowledge on it. My problem is stated below:
Write a program to assign passenger seats in an airplane. Then lets the user to choose a seat or seats he desired. And just assume a small airplane with seats numbered as follows:
1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D
After the user enter his choosen seat(s) the program should display the seat pattern, marking with an '' X '' the seats 1A , 2B, 3C and 4D are taken, the display should look like this:
1 X B C D
2 A X C D
3 A B X D
4 A B C X
5 A B C D
7 A B C D
I hope that you could send me a response with the pascal code I needed. I'll treasure your kindness and cherish it .
Thanks in advance........
Dennis Mejos
Southern Christian Colloge
Student
Answer Hi,
I can give you some hint how to solve your problem, but I won't send you the code - the purpose is to learn how to program it, not just copy-paste.
You should use 2 dimensional array of boolean values to store the taken and empty places. In the begining init the values in the array to false (all seats are empty). Then ask the user to input an integer for a row and a char for the specific place. For the char you should use case statement to determine the number. After that mark the chosen seat as true (it's taken) and that is it!:)