### Minor C++ Problem

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233`` ``````#include #include #include using namespace std; int main() { int airplane[13][6]; char airchar[13][6]; string ticket; int row[2]; char seat; //-------------------------------------------- for(int i = 0; i < 13; i++) { for(int j = 0; j < 6; j++) { airchar[i][j] = '*'; airplane[i][j] = 0; } } //-------------------------------------------- for(;;) { cout<<"Rows 1 and 2 are first class (FC)"<>ticket; cout<<"Desired Row: "; cin>>row[0]; cout<<"Desired seat (A,B,C,D,E or F): "; cin>>seat; switch(seat) { case 'A': case 'a': row[0] = row[0] - 1; row[1] = 1; row[1] = row[1] - 1; break; case 'B': case 'b': row[0] = row[0] - 1; row[1] = 2; row[1] = row[1] - 1; break; case 'C': case 'c': row[0] = row[0] - 1; row[1] = 3; row[1] = row[1] - 1; break; case 'D': case 'd': row[0] = row[0] - 1; row[1] = 4; row[1] = row[1] - 1; break; case 'E': case 'e': row[0] = row[0] - 1; row[1] = 5; row[1] = row[1] - 1; break; case 'F': case 'f': row[0] = row[0] - 1; row[1] = 6; row[1] = row[1] - 1; break; } if(ticket == "FC") { if(row[0]+1 == 1 || row[0]+1 == 2) { if(airplane[row[0]][row[1]] == 0) { airplane[row[0]][row[1]] = 1; airchar[row[0]][row[1]] = 'X'; } else if(airplane[row[0]][row[1]] == 1) { cout<<"Message: Seat "<

Okay Guys, My Output table looks like this right now...

A B C D E F
Row 1 * * * * * *
Row 2 * * * * * *
Row 3 * * * * * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *

But I need it to look like this...

A B C D E F
Row 1 * * X * X X
Row 2 * X X * * X
Row 3 * * X X * *
Row 4 X * X * X X
Row 5 * * * X X X
Row 6 * X * * * X
Row 7 X X X X X X
Row 8 * * * X X *
Row 9 X X * * * *
Row 10 * * * * X X
Row 11 * * * * * *
Row 12 X X X * * *
Row 13 * * X X * *
Last edited on
closed account (3qX21hU5)
I'm just saying this and will keep copying and pasting and improving it with every thread I see like this.

Are you asking your questions correctly? Posters that follow these guidelines are much more likely to have someone work with them to solve their problems.

1) Use codetags whenever you post any code to the forums. If you don't know what they are find out.

2) Relate what you are having problems with specifically. Don't just post "I need help with this" and a wall of code. Tell us exactly what you don't get or exactly what you problem is with very detailed information and code to back it up.

3) If you have error codes post what they are which line they are on and what you have tried to do to correct them. Not just "I have errors help".

4) Be polite. Most people don't have to help you out if they didn't want to, so don't throw their answers back in their face or anything and always be thankful they took time out of their day to help. Also be patient sometimes it takes awhile for someone to log on that knows about your problem and can answer it. If you keep posting it over and over you reduce you chances to be answered.

5) One of the most important. Be willing to learn and do research for yourself. We will help you get through a problem but we won't do it for you. We might give you links to things that might help or snippets of code. It is up to you to go through that and find what you need, not us to tell you exactly what to do.
Last edited on
Sorry, :[

It was just one piece of the program that i need help with.
The program I posted in the OP as a whole works perfectly fine, and there is nothing wrong with it.

I just wanted to know how to change certain *'s into X's
that's all.

lines 15-25
Last edited on
hey! i actually just figured it out on my own :D
no help needed anymore (close thread)
Topic archived. No new replies allowed.