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-17-2008, 02:14 PM
dky8810
Registered Member
 
help me 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
------
Quote:
Originally Posted by dky8810 View Post
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 pls!
pls help me correct it!!
urgent
------
Quote:
Originally Posted by dky8810 View Post
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 pls!
pls help me correct it!!
urgent
------
question:
now is this part make me blur:what i need to write in <if>the code that can let me check still got how many empty place in my cust array and get customer name??
Code:
Code:
for(row=0;row<sizeR;row++){
for(col=0;col<sizeC;col++){
if(0==ID[row][col]){
for(j=0;j<i;j++){
printf("Enter your name");
scanf("%[\n]c",cust[sizeR][sizeC].name);

}
else{
printf("Not enough seats available!The flight is fully booked!");
------
Code:
void Booking(void)
{
	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 con;
	int id;
	int i;
	int j;
	int row;
	int col;
	int flag=0;
	printf("How many seat are you required:\n");
	scanf("%d",&i);
	int available_seats = 0;
		for(row=0; row<sizeR; row++){
			 for(col=0; col<sizeC; col++){
				if(cust[sizeR][sizeC].id == 0){
				     available_seats++;
        }
    }
}
				if(available_seats >= i){
					for(j=0;j<i;j++){
							printf("\t\t\t--- KL Airline Booking Ticket ---\n");
							cust[sizeR][sizeC].id=id;
							id++;
							printf("\t\t\tBooking ID\t:%d",&cust[sizeR][sizeC].id);
							printf("\t\t\tFlight No.:");
							scanf("%s",cust[sizeR][sizeC].flightNo);
							fflush(stdin);
							printf("\t\t\tPassenger:");
							scanf("%[\n]s",cust[sizeR][sizeC].name);
							fflush(stdin);
							printf("\t\t\tDate:");
							scanf("%s",cust[sizeR][sizeC].date);
							fflush(stdin);
							printf("\t\t\tTime:");
							scanf("%s",cust[sizeR][sizeC].time);
							fflush(stdin);
							printf("\t\t\tGate:");
							scanf("%s",cust[sizeR][sizeC].gate);
							fflush(stdin);

							printf("\t\t\tSeat No:");
							scanf("%c",&cust[sizeR][sizeC].seatNo);
							fflush(stdin);
							i++;
							system("pause");
							system("cls");
													

						/*	printf("Want Countinue? press 1");
							scanf("%d",&con);
							if(con==1)
							{
								system("cls");
								Booking();
							}
							else
							{
								system("cls");
								menu();
							}*/
							}
							}
											
											

						
				else{
				printf("Not enough seats available!");
}
why it keep looping??
which line i wrong?



Last edited by dky8810; 11-17-2008 at 02:14 PM.. Reason: Automerged Doublepost

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!

  #2 
Old 11-17-2008, 02:22 PM
Hybrix's Avatar
Hybrix
Través del Espejo
 
I'm pretty sure nobody here knows how to help you with this.

I sure don't. And even if I did, no offense but that's a huge amount of work to expect to get help with for free.

That and the fact that your formatting is terrible. It would take 20 minutes just to format that into something readable.
  #3 
Old 11-17-2008, 02:43 PM
R1pperZ's Avatar
R1pperZ
Registered Member
 
For sure Hybrix, how about you do YOUR work that YOU get paid for or find somebody credible to pay to help or do it for you...
  #4 
Old 11-17-2008, 02:48 PM
icegoat63's Avatar
icegoat63 icegoat63 has 70 feedback on eBay!
Son of Liberty
 
Took me a little while but I finally got it. I agree with Hybrix, your coding was screwed and took some serious effort to figure out. Next time you want some help at least make it easier on the individual.

KL Airline Reservation System solved via Icegoat

Just dont forget to give credit where credit is due.
  #5 
Old 11-18-2008, 07:43 AM
dky8810
Registered Member
 
why
why got so many noob at this forum???i mean supernoob haha!!!
  #6 
Old 11-18-2008, 07:47 AM
Xeilo's Avatar
Xeilo  
How rude, people like you I find annoying in life, and just get in the way when they do things like this.
  #7 
Old 11-18-2008, 09:03 AM
icegoat63's Avatar
icegoat63 icegoat63 has 70 feedback on eBay!
Son of Liberty
 
Quote:
Originally Posted by dky8810 View Post
why
why got so many noob at this forum???i mean supernoob haha!!!
OMG thats almost sig worthy!

problem here is I'm laughing at you not with you
  #8 
Old 11-18-2008, 11:59 AM
dky8810
Registered Member
 
in other forum i will say thk but here.....hehe
i will say mcb
------
Quote:
Originally Posted by icegoat63 View Post
OMG thats almost sig worthy!

problem here is I'm laughing at you not with you
the most big problem here is I'm laughing at you noob!
you are missing i meaning !!!
noob

Last edited by dky8810; 11-18-2008 at 11:59 AM.. Reason: Automerged Doublepost
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
Urgent Help jitjot General Tech 3 05-09-2007 05:52 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:29 PM.

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