/***************************************************************
* Name: Rafael Orta
* Course: Computer Science & Programming
* Class: CS04103 Section: 5
* Assignment Date: 09/21/23
* File Name: switch.cpp
*****************************************************************
* Lecture #: 3
* Purpose: Demonstrate the use of switch statements
*****************************************************************/
#include <iostream>
#include <iomanip>
#include <stdlib.h>
using namespace std;
int main()
{
// Variable declarations
int choice = 0;
// Gathering data
cout << endl;
cout << setw(80) << "******* Welcome to Marriott Hotels reservation system *****" << endl << endl << endl;
cout << setw(65) << "1.- Create a new reservation\n";
cout << setw(71) << "2.- Modify an existing reservation\n";
cout << setw(62) << "3.- Cancel a reservation\n\n";
cout << setw(80) << "Please select your choice and press the <enter key>: ";
cin >> choice;
cout << endl << endl;
// Validating input and displaying results
switch (choice)
{
case 1:
{
system("clear");
cout << setw(80) << "******** Creation of the new reservation ********";
break;
}
case 2:
{
system("clear");
cout << setw(80) << "******** Modification of existing reservation ********";
break;
}
case 3:
{
system("clear");
cout << setw(80) << "******** Cancelation of existing reservation ********";
break;
}
default :
{
cout << setw(80) << "Invalid input, sorry valid choices are (1-3), please try again: ";
cin >> choice;
}
}
}