Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Program -This project will use classes to create a doubly linked list -The s

ID: 657618 • Letter: C

Question

C++ Program

-This project will use classes to create a doubly linked list
-The seating arrangement for each auditorium will be stored in separate files. These files will be named A1.txt,
A2.txt and A3.txt for auditorium 1, 2 and 3 respectively.
-Each line in the file will represent a row in the auditorium. The number of rows in each auditorium is unknown
to you.
-The number of seats in each row of a single auditorium will be the same. For example, if the first line of the file
has 15 seats, then every subsequent row in the theater will also have 15 seats. This does not mean that each
auditorium has the same number of seats in each row. One auditorium may have 15 seats per row and another
may have 20 seats.
-Empty seats are represented by a pound sign (#).
-Reserved seats are represented by a period (.).
-Each file should be read into memory and stored in a linked list
   o For each auditorium, you will have 1 linked list (instead of the 2 linked lists of project 3)
   o The list should be sorted by row and seat number

Explanation / Answer

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>

using namespace std;


void enterMainMenu(ifstream& fIn, ifstream& FfIn);
void exit();
int goAgain(int choice);

//Main function
//---------------------------------------------------------------------------------------------------------------------//

int main()
{
   ifstream fin;
   ifstream Ffin;
int n;
cout<<" *********************************WELCOME***************************";
cout<<"******Enter your choices for seat booking in our auditoriums*******";
cout<<" Enter 1 for auditorium 1";
cout<<" Enter 2 for auditorium 2";
cout<<" Enter 3 for auditorium 3";
cin>>n;
   Ffin.open(n".txt");
   fin.open("rowPrice.txt");
   if (fin.fail() || Ffin.fail())
   {
       cout "Failed to open" //~Function Definition:
//---------------------------------------------------------------------------------------------------------------------//

//Menu:

void enterMainMenu(ifstream& fIn, ifstream& FfIn)
{
   int choice;
   int tickets = 0, temp = 0;
   double seating[15][30];
   int row = -1, seat = -1;
   double money = 0;

   do
   {
       cout<<" Welcome to the Benidum Theater: "<<endl<<"---------------------------------------------" ;
cout<<"1 - Buy tickets" //done;
       cout<<"2 - Tickets sold" //done;
       cout<<"3 - Seating chart" ;
cout<<"4 - Money gained"; //done
       cout<<"5 - Seats avalible in theater" ;
cout<<"6 - Seats avalible in a row" "7 - exit"; //done
       cout<<"---------------------------------------------" ;
cout<<"Pick a sub menu please. Please choose your destination 1-7." <<" "<<endl<<"Choose destination: ";

       cin >> choice;
       goAgain(choice);
       system("cls");

       if (choice == 1)   //buy tickets
       {
           cout.setf(ios::fixed);
           cout.precision(2);

           int counter = 0;
           double pricing[15] = {7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00, 7.00};
              
               system("cls");
               cout<<"Prices:" "Note: There are 30 seats per row:";
cout<< "---------------------------------------------";
cout<< for (int i = 0; i="Row " ":t" "$"<<"---------------------------------------------"<<"What row do you want to sit in: ";
               cin >> row;

                   if (row 15)
                   {
                       system("cls");
                       cout<<"Sorry! That row doesn't exist."<<"Exiting to main menu:" "pause");
                       system("cls");
                   }
                   else
                   {
                       system("cls")
                       cout<<"Seats:"<<"Choose a seat between 1 - 30:"<<"---------------------------------------------"<<"What seat in row "<<" would you like to sit in: ";
                       cin >> seat;
                   }


                   if (seat 30)
                   {
                       system("cls");
                       cout<<"Sorry! That seat doesn't exist."<<"Exiting to main menu:"<<"pause");
                       system("cls");
                   }
                   else
                   {
                       cout<<"You are now sitting in row #"<<" in seat #"<<"pause");
                       system("cls");
                   }

       }
      
       if (choice == 2)
       {
           system("cls");
           cout<<"Ticket Booth: " "---------------------------------------------"<<"#Tickets Sold: "<<" "<<"pause");
           system("cls");
       }
      

       if (choice == 3)
       {
           seating[row][seat];
           for (int y = 0; y for (int x = 0; x if (seating[y][x] = seat)
                       cout "#";
                   else
                       cout "*";
               }
               cout //here
      
       if (choice == 4)
       {
           double getRowPrice[15];
           getRowPrice[row];

           if (row == -1)
           {
               cout.setf(ios::fixed);
               cout.precision(2);
               money += 0.00;
               row = -1;
               cout<<"Money Gained:"<<"--------------------------"<<"$"<<"pause");
               system("cls");
           }

           for (int i = 0; i > getRowPrice[i];
               if (i == row)
               {
                   cout.setf(ios::fixed);
                   cout.precision(2);
                   money += getRowPrice[i];
                   cout<<"Money Gained:" "--------------------------"<<"$"<<"pause");
                   system("cls");
               }
           }
       }
      
       if (choice == 5)
       {

       }
      
       if (choice == 6)
       {
           int temp = 30, counter = 0;
      
       }
      
       if (choice == 7)
           exit();

       if (choice > 8)
       {
           cout<<"Improper Input:" " " "Destination does not exist or doesn't match user input!" " " "pause");
           system("cls");
       }

   }
   while (choice > 0);
}

void exit()
{
   exit(1);
}


int goAgain(int choice)
{
   int a = 0;
   do
   {
       a = 0;

       if (choice > 0)
           return choice;
       if (choice return choice;
       if (choice "Thanks for buying our tickets :)!" "pause");
           exit(0);
       }
   }
   while (a == 1);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote