Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. //reserve seat, seat #, 30 2-3 seatseconomy class, 20 business clas, 10 first class 1
  6.  
  7. //int seatplan(dataType seats[100][100],int rowNo,int colNo)
  8. int main()
  9. {
  10. //declaration
  11. char colNo, rowNo;//user seat input
  12. int row, col;//seatplan
  13. int seats[15][6];
  14. //executable
  15.  
  16.  
  17.  
  18. cout<<"================== SEAT RESERVATION =================="<<endl
  19. <<"row [1-15], coloumn [A-D] "<<endl
  20. <<" ____"<<endl
  21. <<" _------_"<<endl
  22. <<" __________"<<endl;
  23. for(rowNo= 0; rowNo<15; rowNo++)
  24. {
  25. for(colNo = 0; colNo <6; colNo++)
  26. seats [rowNo][colNo] = 'O';
  27. };
  28.  
  29.  
  30. for(row=0 ; row<15; row++)
  31. {
  32. if(row==0)
  33. { cout<<" | A B |"<<endl;}
  34. if(row==5)
  35. { cout<<" |A B C D|"<<endl;}
  36. if(row==10)
  37. { cout<<" |ABC DEF|"<<endl;}
  38. for(col=0 ; col <30; col++)
  39. {
  40. if (row<=9&&col==14)
  41. {
  42. cout<<row;
  43. }
  44. if (row>9&&col==13)
  45. {
  46. cout<<row;
  47. }
  48. if ((row>=0&&row<=4)&&(col<=13 || col==17 || col==19 || col==28 || (col>=21&&col<=26)))
  49. {
  50. cout<<" ";
  51. }
  52. if ((row>=5&&row<=9)&&(col<=13 || col==14 || col==28 || (col>=21&&col<=25)))
  53. {
  54. cout<<" ";
  55. }
  56. if ((row>=10&&row<=14)&&(col<=12||col==14||(col>=23&&col<=26)))//(col>=21&&col<=25))
  57. {
  58. cout<<" ";
  59. }
  60. if (col==18||col==29)
  61. {
  62. cout<<"|";
  63. }
  64. if ((row>=0&&row<=4)&&(col==20||col==27))
  65. {
  66. cout<<seats[rowNo][colNo];
  67. }
  68. if ((row>=5&&row<=9)&&(col==20||col==21||col==27||col==28))
  69. {
  70. cout<<seats[rowNo][colNo];
  71. }
  72. if ((row>=10&&row<=14)&&((col>=20&&col<=22)||(col>=27&&col<=29)))
  73. {
  74. cout<<seats[rowNo][colNo];
  75. }
  76.  
  77. }//for end
  78. cout<<endl;
  79. }//for end
  80. }//seasts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement