General Forum - Forums about everything!




Advanced Computer Discussion Talk about more advanced computer related subjects in here. i.e. programming, networking, OS configurations, etc.

Go Back   General Forum > General > Technology > Computers > Advanced Computer Discussion

» Sponsored Ads
 



160X600 - Love Your New Phone

Reply
 
Thread Tools Display Modes
  #1 
Old 11-16-2008, 03:43 AM
dky8810
Registered Member
 
help help urgent

question:
The airline company, KL AIRLINE, has engaged your teanm to develop a new Airline Ticket Reservation System....airplane wiyh the occupancy of "20 passengers".

!.display the KL "Airline Reservation Menu" for the user to select from 2 main options which are to do "Booking" and "display seat layout & occupancy".thr is one last option -to "exit" from the system after displaying an appropriate farewell message.

2.Booking
-ask user for yhe number of seat required
-Generete the Booking ID(if enough seats are available)
-for each seat required,
*ask for the passenger name,
*assign the booking ID to the seat, and
*display the ticket in following format:
-------------------------------------------------------------------------------------
| --KL airline booking tikcket---- |
| booking ID:100 Flight No.:AK65 |
| Passenger:XXXXXXXXX Date :25-12-2008 |
| Time :23:45 |
| Gate :G9 |
| seat No :3B |
---------------------------------------------------------------------------------------

note Flight No,Date,Time,Gate )will be initizalized either during compile-time or run time.the details are to be stored in a "Struture variable"
-hv all the necessary "validation" in place, including useful messages, "not enough seat available"
- must use a Two Dimensional Array to store the seat information(the booking ID or a Zero value).

3.display seat layout & Occupancy
sample:
A B C D E
|--------------------------------------------|
1 |101 | 101 | 101 |102 | 103 |
|-------------------------------------------|
2 |103 |104 |104 |104 |0 |
|-------------------------------------------|
| Aisle |
|-------------------------------------------|
3 | 0 | 0 | 0 | 0 | 0 |
|-------------------------------------------|
4 | 0 | 0 | 0 | 0 |0 |
|-------------------------------------------|



******required to use :array,structure,Function***********
T.T pls help hv to submit:19 nov 2008
Code:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define sizeR 4
#define sizeC 5

void menu(void);
void Booking(void);
void Display(void);

typedef struct{
	int id;
	char name;
	char flightNo[6];
	char date[10];
	char time[3];
	char gate[1];
	char seatNo[1];
}customer;
customer cust[sizeR][sizeC];

void menu(void)
{
	int choice;

	printf("\t\t********TARC Airlene Reservation Menu*********\n");
	printf("\t\t1) Booking\n");
	printf("\t\t2) Seat Layout & Occupancy\n");
	printf("\t\t3) Exit\n");

	printf("\t\t\tYour choice : ");
	scanf("%d",&choice);

	switch(choice){
	case 1:
		Booking();
		break;
		
	case 2:
		Display();
		break;
	default:
		printf("End the program\n");
		break;
		
		
	}
}

void main()
{

	menu();


}

void Booking(void)
{
	cust[sizeR][sizeC].id=100;
	strcpy(cust[sizeR][sizeC].flightNo,"AK65");
	strcpy(cust[sizeR][sizeC].date,"25-12-2008");
	strcpy(cust[sizeR][sizeC].time,"23:45");
	strcpy(cust[sizeR][sizeC].gate,"G9");
	int ID[4][5]={
	{0,0,0,0,0},
	{0,0,0,0,0},
	{0,0,0,0,0},
	{0,0,0,0,0}
	};
	
	int i;
	int row;
	int col;
	int flag=0;
	printf("How many seat are you required:\n");
	scanf("%d",&i);
	for(row=0;row<sizeR;row++){
		for(col=0;col<sizeC;col++){
			if(0==ID[row][col]){
				flag=1;
				break;
			
	

		if(flag==0)
		/*	for(i=0;i<cust[sizeR][sizeC];i++){*/
			printf("Please enter your name\n");

		/*	}*/
		else
			printf("Not enough seats available!The flight is fully booked!");

	}
	}
	}
}

			
			
void Display(void)
{
	printf("\t\t   A\t   B\t   C\t   D\t   E\n");
	printf("\t\t_________________________________________\n");
	printf("\t1\t|\t\t\t\t\t|\n");
	printf("\t\t_________________________________________\n");
	printf("\t2\t|\t\t\t\t\t|\n");
	printf("\t\t_________________________________________\n");
	printf("\t\t|\t\tAisle\t\t\t|\n");
	printf("\t\t_________________________________________\n");
	printf("\t3\t|\t\t\t\t\t|\n");
	printf("\t\t_________________________________________\n");
	printf("\t4\t|\t\t\t\t\t|\n");
	printf("\t\t_________________________________________\n");


}
pls help me correct it!!
help !!pls



Join GeneralForum.com Today!

Join GeneralForum.com today for FREE!

GeneralForum.com is the fastest growing general forum on the web!

  • Join thousands of discussions on every topic imaginable!
  • Chat with people from all over the world in real time!
  • Play live games with other members in real time! 
  • Make new friends, discuss new ideas, talk about whatever!
  • Yes, it's free! What are you waiting for? DO IT NOW!
» Click here to join the fun!

Closed Thread

  General Forum > General > Technology > Computers > Advanced Computer Discussion

Bookmarks

Tags
urgent



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent! Please Answer!!! kkid Playstation 3 4 06-30-2008 03:42 PM
Please help this is urgent!!! drupr2 Advanced Computer Discussion 1 02-02-2008 08:56 PM
URGENT!!! Request FCXShogun General Tech 4 09-15-2006 03:33 PM
URGENT PRAYERS PLEASEEEEEEEE LostForever General Discussion 24 07-22-2006 01:59 AM



 


All times are GMT -6. The time now is 03:58 AM.

Powered by: vBulletin | Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Site designed and maintained by NURV® Original Concepts, Graphics, and Design Copyright © NURV® 2010
All user submitted content, threads and posts becomes the copyright-protected property of GeneralForum.com unless previously copyrighted.
The views and opinions expressed on this site are not necessarily the views of the staff or administration.
We are not responsible, nor can we be held liable for information posted on this site, or what it influences you to do.
Rules & Privacy Policy

3D Motion Graphics | Poker Design | Web Design | Mafia Graphics | Pop Culture News | Money Forum | Make Money Online | Stephen King