ONLINE COMPILERS
LIBRARY
MANUAL PAGES & DOCS
CONTACT
Latest Users' Questions
User Submitted Source Code!
Description:
Airway Management
Language: C/C++
Code:
Airway Management
Language: C/C++
Code:
#include <stdio.h>
#include <stdlib.h>
int main(){
//Declaring Variables
int flight_no, cust_id, age;
float bag_w, weight;
char cust_name[30];
char from[20];
char destn[20];
char gndr[20];
char clb_mem[1];
char date[20];
//Giving Passenger Required Information
printf("******************************************************************************n");
printf(" Welcome to Airways Managementn");
printf("n");
printf("Flights available are :nG123 Bangalore - ChennainH124 Bangalore - PunenK126 Bangalore to Mumbain567 Bangalore - Hyderabadnn");
printf("Seats available are :n123 Bangalore - Chennai (22)n124 Bangalore - Pune (15)n125 Bangalore to Mumbai (27)n126 Bangalore - Hyderabad(6)nn");
printf("******************************************************************************n");
//Taking Input From User
printf(" Customer Registration Formn");
printf("nEnter Customer Name : ");
scanf("%s", cust_name);
printf("nEnter Customer ID : ");
scanf("%d", &cust_id);
printf("nEnter Customer age : ");
scanf("%d", &age);
printf("nEnter Customer Baggage weight : ");
scanf("%f", &bag_w);
printf("nEnter Customer Weight : ");
scanf("%f", &weight);
printf("nEnter Customer gender(male/female): ");
scanf("%s", gndr);
printf("nEnter Date of Journey (DD.MM.YY) : ");
scanf("%s", date);
printf("nEnter Flight Number : ");
scanf("%d", &flight_no);
printf("nBoarding From : ");
scanf("%s", from);
printf("nDestination : ");
scanf("%s", destn);
printf("nDo you have club membership?(y/n) : ");
scanf("%s", clb_mem);
system("cls");
//Printing Out the form
printf("***************************************************************************************n");
printf(" Welcome to Airways Managementn");
printf("n");
printf("Flights available are :nG123 Bangalore - ChennainH124 Bangalore - PunenK126 Bangalore to Mumbain567 Bangalore - Hyderabadnn");
printf("Seats available are :n123 Bangalore - Chennai (22)n124 Bangalore - Pune (15)n125 Bangalore to Mumbai (27)n126 Bangalore - Hyderabad(6)nn");
printf("********************************************************************************************nnn");
printf(" Booking Summarynn");
printf("Passenger Name : %sn", cust_name);
printf("Passenger Age : %dn", cust_id);
printf("Baggage Weight : %fn", bag_w);
printf("Passenger Weight : %fn", weight);
printf("Passenger Gender : %sn", gndr);
printf("Date of Journey : %sn", date);
printf("Flight Number : %dn", flight_no);
printf("Boarding From : %sn", from);
printf("Destination : %sn", destn);
printf("Club Membership : %sn", clb_mem);
printf("*******************************************************************************************n");
printf(" Thank You for using our Airway system! Have a safe journey!n");
printf("***************************************************************n");
return 0;
}
#include <stdlib.h>
int main(){
//Declaring Variables
int flight_no, cust_id, age;
float bag_w, weight;
char cust_name[30];
char from[20];
char destn[20];
char gndr[20];
char clb_mem[1];
char date[20];
//Giving Passenger Required Information
printf("******************************************************************************n");
printf(" Welcome to Airways Managementn");
printf("n");
printf("Flights available are :nG123 Bangalore - ChennainH124 Bangalore - PunenK126 Bangalore to Mumbain567 Bangalore - Hyderabadnn");
printf("Seats available are :n123 Bangalore - Chennai (22)n124 Bangalore - Pune (15)n125 Bangalore to Mumbai (27)n126 Bangalore - Hyderabad(6)nn");
printf("******************************************************************************n");
//Taking Input From User
printf(" Customer Registration Formn");
printf("nEnter Customer Name : ");
scanf("%s", cust_name);
printf("nEnter Customer ID : ");
scanf("%d", &cust_id);
printf("nEnter Customer age : ");
scanf("%d", &age);
printf("nEnter Customer Baggage weight : ");
scanf("%f", &bag_w);
printf("nEnter Customer Weight : ");
scanf("%f", &weight);
printf("nEnter Customer gender(male/female): ");
scanf("%s", gndr);
printf("nEnter Date of Journey (DD.MM.YY) : ");
scanf("%s", date);
printf("nEnter Flight Number : ");
scanf("%d", &flight_no);
printf("nBoarding From : ");
scanf("%s", from);
printf("nDestination : ");
scanf("%s", destn);
printf("nDo you have club membership?(y/n) : ");
scanf("%s", clb_mem);
system("cls");
//Printing Out the form
printf("***************************************************************************************n");
printf(" Welcome to Airways Managementn");
printf("n");
printf("Flights available are :nG123 Bangalore - ChennainH124 Bangalore - PunenK126 Bangalore to Mumbain567 Bangalore - Hyderabadnn");
printf("Seats available are :n123 Bangalore - Chennai (22)n124 Bangalore - Pune (15)n125 Bangalore to Mumbai (27)n126 Bangalore - Hyderabad(6)nn");
printf("********************************************************************************************nnn");
printf(" Booking Summarynn");
printf("Passenger Name : %sn", cust_name);
printf("Passenger Age : %dn", cust_id);
printf("Baggage Weight : %fn", bag_w);
printf("Passenger Weight : %fn", weight);
printf("Passenger Gender : %sn", gndr);
printf("Date of Journey : %sn", date);
printf("Flight Number : %dn", flight_no);
printf("Boarding From : %sn", from);
printf("Destination : %sn", destn);
printf("Club Membership : %sn", clb_mem);
printf("*******************************************************************************************n");
printf(" Thank You for using our Airway system! Have a safe journey!n");
printf("***************************************************************n");
return 0;
}
Comments: