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
C LANGUAGEA private railway company has just purchased a computer for its new automated reservationssystem. You have been asked to write a program to assign seats on each train of the railway havingonly (capacity: 100 seats). Your program should check whether it is a valid seat number or not.Also print its berth type i.e lower berth, middle berth, upper berth, side lower berth, side upperberth. Furthermore, then print a ticket indicating the person's seat number and whether it’s in the firstclass or economy section of the train. Use a single-subscripted array to represent the seating chartof the train. Initialize all the elements of the array to 0 to indicate that all seats are empty. As eachseat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longeravailable.
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 programming.

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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr