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]
3 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]3 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
Consider a regenerative gas-turbine power plant with two stages of compression and two stages of expansion. The overall pressure
iris [78.8K]

Answer: the minimum mass flow rate of air required to generate a power output of 105 MW is 238.2 kg/s

Explanation:

from the T-S diagram, we get the overall pressure ratio of the cycle is 9

Calculate the pressure ratio in each stage of compression and expansion. P1/P2 = P4/P3  = √9 = 3

P5/P6 = P7/P8  = √9 =3  

get the properties of air from, "TABLE A-17 Ideal-gas properties of air", in the text book.

At temperature T1 =300K

Specific enthalpy of air h1 = 300.19 kJ/kg

Relative pressure pr1 = 1.3860  

At temperature T5 = 1200 K

Specific enthalpy h5 = 1277.79 kJ/kg

Relative pressure pr5 = 238  

Calculate the relative pressure at state 2

Pr2 = (P2/P1) Pr5

Pr2 =3 x 1.3860 = 4.158  

get the two values of relative pressure between which the relative pressure at state 2 lies and take the corresponding values of specific enthalpy from, "TABLE A-17 Ideal-gas properties of air", in the text book.  

Relative pressure pr = 4.153

The corresponding specific enthalpy h = 411.12 kJ/kg  

Relative pressure pr = 4.522

The corresponding specific enthalpy h = 421.26 kJ/kg  

Find the specific enthalpy of state 2 by the method of interpolation

(h2 - 411.12) / ( 421.26 - 411.12) =  

(4.158 - 4.153) / (4.522 - 4.153 )

h2 - 411.12 = (421.26 - 411.12) ((4.158 - 4.153) / (4.522 - 4.153))  

h2 - 411.12 = 0.137

h2 = 411.257kJ/kg  

Calculate the relative pressure at state 6.

Pr6 = (P6/P5) Pr5

Pr6 = 1/3 x 238 = 79.33  

Obtain the two values of relative pressure between which the relative pressure at state 6 lies and take the corresponding values of specific enthalpy from, "TABLE A-17 Ideal-gas properties of air", in the text book.  

Relative pressure Pr = 75.29

The corresponding specific enthalpy h = 932.93 kJ/kg  

Relative pressure pr = 82.05

The corresponding specific enthalpy h = 955.38 kJ/kg  

Find the specific enthalpy of state 6 by the method of interpolation.

(h6 - 932.93) / ( 955.38 - 932.93) =  

(79.33 - 75.29) / ( 82.05 - 75.29 )

(h6 - 932.93) = ( 955.38 - 932.93) ((79.33 - 75.29) / ( 82.05 - 75.29 )

h6 - 932.93 = 13.427

h6 = 946.357 kJ/kg

Calculate the total work input of the first and second stage compressors

(Wcomp)in = 2(h2 - h1 ) = 2( 411.257 - 300.19 )

= 222.134 kJ/kg  

Calculate the total work output of the first and second stage turbines.

(Wturb)out = 2(h5 - h6) = 2( 1277.79 - 946.357 )

= 662.866 kJ/kg  

Calculate the net work done

Wnet = (Wturb)out  - (Wcomp)in

= 662.866 - 222.134

= 440.732 kJ/kg  

Calculate the minimum mass flow rate of air required to generate a power output of 105 MW

W = m × Wnet

(105 x 10³) kW = m(440.732 kJ/kg)

m = (105 x 10³) / 440.732

m = 238.2 kg/s

therefore the minimum mass flow rate of air required to generate a power output of 105 MW is 238.2 kg/s

4 0
3 years ago
How many robots does bailey nursery own ​
givi [52]

Answer:

The Bailey family has flourished during its business’ 110-year history. But Bailey Nurseries’ leaders still operate with the belief that the family doesn’t always know best. The company has grown from a one-man operation selling fruit trees and ornamental shrubs to one of the largest wholesale nurseries in the United States, thanks to insights from those who are family and those who aren’t.

“For a business to thrive, you have to ask for outside help,” says Terri McEnaney, president of the Newport-based company and a fourth-generation family member. “We get an outside perspective through family business programs, advisors and our board, because you can get a bit ingrained in your own way of thinking.”

When Bailey Nurseries chose its current leader in 2000, it brought in a facilitator who gathered insights from key employees, board members and owners. Third-generation leaders (and brothers) Gordie and Rod Bailey picked Rod’s daughter McEnaney, who had experience both inside and outside the company.

Explanation:

5 0
3 years ago
The ???? − i relationship for an electromagnetic system is given by ???? = 1.2i1/2 g where g is the air-gap length. For current
Artemon [7]

Answer:

a) The mechanical force is -226.2 N

b) Using the coenergy the mechanical force is -226.2 N

Explanation:

a) Energy of the system:

\lambda =\frac{1.2*i^{1/2} }{g} \\i=(\frac{\lambda g}{1.2} )^{2}

\frac{\delta w_{f} }{\delta g} =\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }

f_{m}=- \frac{\delta w_{f} }{\delta g} =-\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }

If i = 2A and g = 10 cm

\lambda =\frac{1.2*i^{1/2} }{g} =\frac{1.2*2^{1/2} }{10x10^{-2} } =16.97

f_{m}=-\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }=-\frac{16.97^{3}*2*0.1 }{3*1.2^{2} } =-226.2N

b) Using the coenergy of the system:

f_{m}=- \frac{\delta w_{f} }{\delta g} =-\frac{1.2*2*i^{3/2}  }{3*g^{2} }=-\frac{1.2*2*2^{3/2} }{3*0.1^{2} } =-226.2N

8 0
3 years ago
Why do we need technical sketching?
Scrat [10]

Technical Drawings give a better understanding of what is needed and required in the project.

Explanation:

8 0
3 years ago
Read 2 more answers
Ignoring any losses, estimate how much energy (in units of Btu) is required to raise the temperature of water in a 90-gallon hot
Rudik [331]

Answer:

Q=36444.11 Btu

Explanation:

Given that

Initial temperature = 60° F

Final temperature = 110° F

Specific heat of water = 0.999 Btu/lbm.R

Volume of water = 90 gallon

Mass = Volume x density

1\ gallon = 0.13ft^3

Mass ,m= 90 x 0.13 x 62.36 lbm

m=729.62 lbm

We know that sensible heat given as

Q= m Cp ΔT

Now by putting the values

Q= 729.62 x 0.999 x (110-60) Btu

Q=36444.11 Btu

5 0
3 years ago
Other questions:
  • The Clausius inequality expresses which of the following laws? i. Law of Conservation of Mass ii. Law of Conservation of Energy
    8·1 answer
  • The heat flux through a 1-mm thick layer of skin is 1.05 x 104 W/m2. The temperature at the inside surface is 37°C and the tempe
    8·1 answer
  • A rectangular block having dimensions 20 cm X 30 cm X 40 cm is subjected to a hydrostatic stress of -50 kPa (i.e. under compress
    15·1 answer
  • james wants to qualify for icp are and licensure. Which degree would be required in order to qualify for a two year master of ar
    15·1 answer
  • Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    10·1 answer
  • What are the important things to remember when arriving for an interview?
    15·1 answer
  • An experimental arrangement for measuring the thermal conductivity of solid materials involves the use of two long rods that are
    8·1 answer
  • Calculate the resistance of a circuit with 1.5 A and 120 V. Use the appropriate formula from the list of formulas on the
    9·1 answer
  • How do you identify all sensors, functions, and where we can use them?
    12·1 answer
  • When you hover over an edge or point, you are activating ____________ in SketchUp?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!