0/ ort &My.Emich; Assignments>Assignment9 Submit Assignmen Assignment 9 Due Apr
ID: 3699338 • Letter: 0
Question
0/ ort &My.Emich; Assignments>Assignment9 Submit Assignmen Assignment 9 Due Apr 10 by 11:59pm Points 40 Submitting a file upload Please download and modify Tutorial20111.html from chapter 20. 1. Add an array to hold "Departure Time" for all the flights: Time format:"0800A, "1135P" 2. Add two more flights from these two airlines: United and AA, and makeup all the related information. Make sure the user can pick the flight number form the prompt box. 3. Using Table" to display the flight information like the following: (hint: use example 203 as reference) Here is your flight info Airline: Flight Number: 111 Terminal: E Gate: 30 Departure Time: 0923P United If your flight departure time is 1/2 hr from now, please proceed to gate Thank you for choosing our airline. Have a safe and nice trip. fox in a while. Do you want to clean it up for a fresh, like-new experience? And by the way, welcome backExplanation / Answer
ScreenShot
------------------------------------------------------------------------------------------------------------------------------------------
Program
//Header Files
#include <stdio.h>
#include<string.h>
//Main function
int main(void) {
//Variable declaration
int fNumber,i;
//Array declaration and initialization
char airline[8][20]={"Lufthanza","Swiss Air","USAir","Delta","British Airways","Air France","United","AA"};
int flightNumber[]={356,89,1230,952,513,910,111,121};
char terminal[]={'E','D','A','C','B','F','E','H'};
int gate[]={5,10,3,7,1,8,30,2};
char departureTime[8][20]={"0080A","1135P","2546A","1056P","0180A","3519P","0923P","0312A"};
//Ask user for flight number
printf("Please Enter the flight Number (356,89,1230,952,513,910,111,121) : ");
scanf("%d",&fNumber);
//Loop through get the details
for( i = 0; i <8; i++){
//Compare flight number
if(fNumber==flightNumber[i]){
//Display data
printf(" Here is your flight info ");
printf(" -------------------------");
printf(" Airline:%s",airline[i]);
printf(" Flight Number:%d",flightNumber[i]);
printf(" Terminal:%c",terminal[i]);
printf(" Gate:%d",gate[i]);
printf(" Departure Time:%s",departureTime[i]);
printf(" If your flight departure time is 1/2 hr from now,please proceed to gate.");
printf(" Thank you for choosing our airline.Have a safe and nice trip");
}
}
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.