C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey 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
Use C Language Airline Reservation System   A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats). Your program should display the following menu of alternatives:   Please type 1 for "first class" Please type 2 for "economy"   If the person types 1, then your program should assign a seat in the first class section (seats 1-5). If the person types 2, then your program should assign a seat in the economy section (seats 6-10). Your program should then print a boarding pass indicating the person's seat number and whether it is in the first class or economy section of the plane. Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of…
INFS3410 Practice Questions Chapters 1, 2 and 3 The Following is an example run of an educational program for school children. The program help kids to practice their additions and subtraction skills. Your task is to develop a program that can achieve the same exact thing. Bear in mind the following important guidelines: - The user may choose between additions and subtractions - The user may choose the difficulty level (easy, medium, hard) - The program should display 5 questions and calculate the total score - No two questions should be the same Please enter your name: Hafedh AlShihi ************** Hello Hafedh AlShihi Welcome to our Additions / Subtractions Practice ****k********* Which operation you want to practice? Type 1 for Additions, or Type 2 for subtractions: 2 Please select your difficulty level Type 1 for Easy (numbers 1 to 10) Type 2 for Medium (numbers 10 to 100) Type 3 for Hard (numbers 100 to 1000) 1 Here are 5 easy-level subtraction questions, please attempt all: How…
Python: VOWEL OR CONSONANT Challange   Ask the user to input a word.  The program will then tell them how many letters are in the inputted word.  It will also tell them how many vowels and consonants are in the word.  It will then ask which number (between 1- the length of their word - DO NOT USE THE PLACEHOLDER ZERO) that they would like to pick.  It will then tell them whether that letter is a vowel or consonant.  Next the program will pick a random letter from the word that was inputted, print that letter and tell the user whether it is a vowel or consonant:   OUTPUT: What is your word?:  Larry There are 5 letters in Larry.   There are 1 vowel and 4 consonants For your word, L is  "1" and Y is  "5" Which letter do you want 1-5? 4 The letter you picked is an "r" and that letter is a CONSONANT and there are two of them I picked a random letter from your word, it is "a" The letter I randomly picked is a VOWEL   Remember :  vowels are "a, e, i, o, u"  a "y",should output as "…

Chapter 6 Solutions

C How to Program (8th Edition)

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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education