All pastes #942268 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-14 12:04 UTC
rendered paste body

#include "iostream"



using namespace std;

bool O;
bool X;
int i;
int j;
int seattype;


bool Cinema[20][15] = {
O,O,O,O,O,O,O,O,X,X,O,O,O,O,X,
O,O,O,O,O,O,X,X,X,X,X,O,X,X,O,
X,O,X,O,X,X,X,O,X,O,X,O,X,X,X,
O,O,O,O,X,O,X,O,X,O,O,O,O,X,O,
O,O,O,O,O,X,X,X,X,X,O,O,O,O,O,
O,X,X,X,X,X,O,O,O,O,O,O,X,X,X,
O,O,O,O,O,O,O,O,O,O,O,O,X,O,O,
O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,    // 1   $3
O,O,X,O,X,O,X,O,O,O,X,X,X,X,X,
X,X,X,X,X,X,X,O,O,O,X,X,X,X,X,
X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
O,O,X,O,O,X,O,O,O,O,O,X,X,O,X,
X,X,X,O,O,X,O,O,O,O,O,O,O,O,O,
O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,
O,O,O,O,O,O,O,O,O,X,O,O,O,O,O,    //2 $4
O,O,X,X,X,X,X,X,O,O,O,O,O,X,O,
O,O,O,O,O,O,O,O,X,X,O,X,X,X,X,
O,X,O,O,O,O,X,X,X,X,X,X,X,O,O,
O,O,O,O,O,O,O,X,X,O,O,O,O,O,O,
O,O,O,O,O,X,X,X,X,X,X,O,X,O,O};   // 3  $5


/*
int price() 
{
    
    cout<<" Please Enter what you would like to do"<<endl;
    cout<<" Enter '1' To rent a Low grade Seat";
    cout<<" Enter '2' To rent a Medium grade seat"<<endl;
    cout<<" Enter '3' To rent a High grade seat"<<endl;
    cout<<" Enter '4' To Show the amount of Empty spaces"<<endl; 
    cin >> seattype;
    
    while(seattype =! 0) {
                   
                   
    
    if(seattype == 1) {
          //Insert Function here      
                }
                
    if(seattype == 2) {
           //Insert Function here     
                }
                
    if(seattype == 3) {
           //Insert Function here     
                }
                
    if(seattype == 4) {
           //Insert Function here     
                }            
                
                else {
                     cout <<"****** ERROR NO SUCH SEAT TYPE ********"<<endl;
                     }
    cout<<" Please Enter what kind of a Spot you would like to rent"<<endl;
    cout<<" Enter '1' for Low grade Seat";
    cout<<" Enter '2' for a Medium grade seat"<<endl;
    cout<<" Enter '3' for a High grade seat"<<endl;
    cin >> seattype;
    
}
}

return 0;
                     
} 
            

    
    */
    
    
    
  
int ShowEmptySpaces() {
    
   int counterO = 0;
   int i;

   for(i=0;i<=299;i++) {
     if(i==X) {
          break;
         
          }
          else {
               counterO++;
              
               }
               cout <<"The amount of Empty spaces is"<<counterO;
               }
     
     return 0;
     
     }    
     




void SetSeatPrice ();
void SetSeatPrice () {
int i;
 int j;
  int Price1 = 3;
   int Price2 = 4;
     int Price3 = 5;
           

        while(Cinema[i][j])
        {
                  for(i=0; i<15; i++) {
                  for(j=0; j<20; j++) {
                      
                                if(j<=8 && i<=15) {
                                 Cinema[i][j]=Price1;
                                
                                
                       
                       
                                    if(j<=15 && i<=15) {
                                    Cinema[i][j]=Price2;
                                    
                              
                                         if(j<=20 && i<=15) {
                                         Cinema[i][j]=Price3;
                                       }
                                       }
                                       }
                                       }
                                       }
                                       }
                                       }
                                     
                                       
int Booking()
{
int row;
int counter = 0;

cout <<" Enter the Row you want to check for empty spaces";
cin >> row;
cout <<" Enter the Seat of the column you would like to check";


                  	
                  for(j=0; j<20; j++) {
                     if(Cinema[j] == row){cout <<"Seat #"<<Cinema[i];
                  		for(i=0; i<15; i++) {
                  			if(Cinema[i] == X) {
                  				
                  				
                  				counter++;
                  				break;
                  			}
                  			else