EBK C HOW TO PROGRAM
EBK C HOW TO PROGRAM
8th Edition
ISBN: 8220100663833
Author: Deitel
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 6, Problem 6.21E
Program Plan Intro

Program Plan-

  • Initialize the header files and main().
  • Declare capacity of the airplane with the number of seats 10.
  • Prompt the user to enter the type of class with two choices first-class or economy class.
  • To define the function firstClassSeat(int []) and economyClassSeat(int[]) to assign the seat to passengers with next available seat.
  • Return 1 if the seat is assigned otherwise return 0 and print the message “Next flight leaves in three hours”.
  • To define the function printPass(int) to print the boarding pass of the passengers taking the seat number as an argument.
  • Declare the variables for calculations.
  • Call the function from main() to evaluate and display the output.

Summary Introduction- The program is about the automated reservation of the seats in an airplane based on the type of class.

Program Description- The purpose of the program is to print the boarding pass for the passenger on the basis of the input information given by the passenger.

Blurred answer
Students have asked these similar questions
Write the code completely.
What is the output from each of the following pseudocode statements?
What is the output of the following code segment?

Chapter 6 Solutions

EBK C HOW TO PROGRAM

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning