1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
schepotkina [342]
2 years ago
7

8.19 - Airline Reservations System (Project Name: Airline) - A small airline has just purchased a computer for its new automated

reservations system. You have been asked to develop the new system. You’re to write an app to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Display the following alternatives: Please enter 1 for First Class or 2 for Economy. If the user types 1, your app should assign a seat in the first-class section (seats 1–5). If the user types 2, your app should assign a seat in the economy section (seats 6–10). Use a one-dimensional array of type bool to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your app should never assign a seat that has already been assigned. When the economy section is full, your app should ask the person if it’s acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours."
Engineering
1 answer:
e-lub [12.9K]2 years ago
8 0

Answer:

The App is written in C++ language using dev C++.

Explanation:

/******************************************************************************

You can run this program in any C++ compiler like dev C++ or any online C++ compiler

*******************************************************************************/

#include <iostream>

using namespace std;

class bookingSeat// class for airline reservation system

{

  private:

   

   

  bool reserveSeat[10];// 10 seats (1-5) for first class and 6-10 for economy class

  int firstClassCounter=0;//count first class seat

  int economyClassCounter=5;//count economy class seat

  char seatPlacement;/* switch between economy and first clas seat----- a variable for making decision based on user input*/

  public:  

  void setFirstClassSeat()//

  {

      if(firstClassCounter<5)// first class seat should be in range of 1 to 5

      {

          reserveSeat[firstClassCounter]=1; /*set first class seat..... change index value to 1 meaning that it now it is reserved*/

          cout<<"Your First Class seat is booked and your seat no is "<<firstClassCounter+1; //display seat number reserved

          firstClassCounter++; //increament counter

      }

      else//in case seats are ful

      {

          cout<<"\nSeats are full";

          if(economyClassCounter==10 && firstClassCounter==5)

          {

              cout<<"\n Next flight leaves in 3 hours.";

          }

          else

          {

              cout<<"\nIt’s acceptable to be placed to you in the first-class section  y/n ";//take input from user

              cin>>seatPlacement;//user input

              if(seatPlacement=='y')//if customer want to reserve seat in first class

              {

                  setEconomyClassSeat();// then reserve first class seat

              }

              else

              {

                  cout<<"\n Next flight leaves in 3 hours.";

               }

               

          }

      }

       

  }

  void setEconomyClassSeat()//set economy class seat

  {

    if(economyClassCounter<10)//seat ranges between 6 and 10

      {

          reserveSeat[economyClassCounter]=1;// reserve economy class seat

          cout<<"Your Economy class seat is booked and your seat no is "<<economyClassCounter+1;//display reservation message about seat

          economyClassCounter++;//increament counter

      }

      else// if economy class seats are fulled

      {

          cout<<"\nSeats are full";

          if(economyClassCounter==10 && firstClassCounter==5)//check if all seats are booked in both classes

          {

              cout<<"\n Next flight leaves in 3 hours.";

          }

          else

          {

              cout<<"\nIt’s acceptable to be placed to you in the first-class section  y/n ";//take input from user

              cin>>seatPlacement;//user input

              if(seatPlacement=='y')//if customer want to reserve seat in first class

              {

                  setFirstClassSeat();// then reserve first class seat

              }

              else

              {

                  cout<<"\n Next flight leaves in 3 hours.";

               }

               

          }

      }

  }

   

   

};

int main()

{   int checkseat=10;// check seat

   int classType;//class type economy or first class

   bookingSeat bookseat;//object declaration of class bookingSeat

   while(checkseat<=10)//run the application until seats are fulled in both classes

   {

       cout<<"\nEnter 1 for First Class and 2 for Economy Class ";

       cin>>classType;//what user entered

       switch (classType)//decide which seat class to be reserved  

       {

           case 1://if user enter 1 then reserve first class seat

           bookseat.setFirstClassSeat();

           break;

           case 2://if user enter 2 then reserve the economy class seat

           bookseat.setEconomyClassSeat();

           

       }

       

   }

   

   return 0;

}

You might be interested in
Are the communication skills required for a team leader in a manufacturing plant different from those of a customer service exec
Svetllana [295]

Answer:

Explanation: Excellent customer service isn’t just down to your frontline staff, but a customer might be won or lost there. That’s why it’s so important every employee works together to resolve issues and create memorable moments – and empower your frontline agents to be as valuable to the customer as possible. It could be the difference between the customer coming back again, or going elsewhere.

The following tips are designed to help both customer service representatives, customer service management, and operations staff to work together to make experiences that matter. Developing customer service skills is important for the whole team to thrive – and to ensure customers keep coming back.

Customer service representative tips

Practice active listening

Learn to empathize with your customers

Use positive language

Improve your technical skills

Know your products and services

Look for common ground

Communicate clearly

Be solutions-focused

Admit mistakes

Be willing to learn

Customer service team management and operations tips

Provide first-class training

Set your standards high

Have a clear escalation pathway

Align your touchpoints

Create a culture of excellence

Be smart about automation

Use tools that boost speed and efficiency

Measure and analyze customer feedback

Use closed-loop feedback

Listen, understand and take action

5 0
2 years ago
Recall the steps of the engineering design process. Compare and contrast the
Marta_Voda [28]

Answer:

hi

Explanation:

hiiiiiiiiiiiiiiiiiiiiiiiii

3 0
2 years ago
If Ella decided to become a children’s doctor, what career cluster would she belong in?
vodomira [7]
D . Health Services
8 0
2 years ago
What are some quality assurance systems
Aloiza [94]
Examples of quality assurance activities include process checklists, process standards, process documentation and project audit. Examples of quality control activities include inspection, deliverable peer reviews and the software testing process. You may like to read more about the quality assurance vs quality control.
7 0
2 years ago
Can be used to eliminate rubbing friction of wheel touching frame. 1.Traction 2.Thrust washer
Vilka [71]

Answer:

thrust washer

can be used to eliminate rubbing friction of wheel touching frame

5 0
2 years ago
Other questions:
  • Air at 7°C enters a turbojet engine at a rate of 16 kg/s and at a velocity of 220 m/s (relative to the engine). Air is heated in
    7·1 answer
  • Thermal conductivity of AISI 316 Stainless Steel at 90ºC is 14.54 W/m K. Convert this value to IP system.
    8·1 answer
  • The air contained in a room loses heat to the surroundings at a rate of 50 kJ/min while work is supplied to the room by computer
    11·2 answers
  • IN JAVA,
    6·1 answer
  • How long does it take to get a master's degree in Mechanical engineering?
    12·1 answer
  • What are the nominal dimensions for a 1x2 stick of lumber, a 2x4 stick of lumber and a standard sheet of plywood?
    11·1 answer
  • a poorly tighten terminal is often the cause of a/an ? a) open circuit b) circuit breaker interrupt c)short circuit d) ground fa
    10·1 answer
  • If an elevator repairer observes that cables begin to fray after 15 years, what process might he or she use to create a maintena
    11·1 answer
  • Deviations from the engineering drawing cannot be made without the approval of the
    15·2 answers
  • fdkgdsvdgvdfgvsdcvbfbfdbvfdbsdvbesgvdslgfkrledmgoskflodjgloerjgvoljgegjp;erorf;wgp;kiaers;ogjo;rhgerjfrejgfdlhodjglodjheihtgo;rg
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!