/*open.cpp Determines whether an automatic sliding door should be activated. *Programmer: Justen Long *Block: 3B October 14th, 2002 *Input: State of the front pad, rear pad, and door. *Output: Message stating whether or not the door should be activated. ***************************/ #include int main() { int front; int rear; int door; cout << "Is the front pad occupied? (1 for yes, 0 for no): "; cin >> front; cout << "Is the rear pad occupied? (1 for yes, 0 for no): "; cin >> rear; cout << "Is the door open or closed? (1 for open, 0 for closed): "; cin >> door; if(front==1&&rear==1&&door==1) { cout << "The door remains open.\n"; } else if(front==1&&rear==1&&door==0) { cout << "The door should open.\n"; } else if(front==1&&rear==0&&door==1) { cout << "The door remains open.\n"; } else if(front==1&&rear==0&&door==0) { cout << "The door should open.\n"; } if(front==0&&rear==1&&door==1) { cout << "The door remains open.\n"; } else if(front==0&&rear==0&&door==1) { cout << "The door should close.\n"; } else if(front==0&&rear==0&&door==0) { cout << "The door remains closed.\n"; } return 0; } /*0.0.0 Is the front pad occupied? (1 for yes, 0 for no): 0 Is the rear pad occupied? (1 for yes, 0 for no): 0 Is the door open or closed? (1 for open, 0 for closed): 0 The door remains closed. Press any key to continue */ /*0.0.1 Is the front pad occupied? (1 for yes, 0 for no): 0 Is the rear pad occupied? (1 for yes, 0 for no): 0 Is the door open or closed? (1 for open, 0 for closed): 1 The door should close. Press any key to continue */ /*1.1.0 Is the front pad occupied? (1 for yes, 0 for no): 1 Is the rear pad occupied? (1 for yes, 0 for no): 1 Is the door open or closed? (1 for open, 0 for closed): 0 The door should open. Press any key to continue */ /*1.1.1 Is the front pad occupied? (1 for yes, 0 for no): 1 Is the rear pad occupied? (1 for yes, 0 for no): 1 Is the door open or closed? (1 for open, 0 for closed): 1 The door remains open. Press any key to continue */