الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعدة فى سي ضرورى

بدأه gwen في 16 نوفمبر 2010 · 8 رد · 581 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
void mainmenu(void);
void menu_PurchaseTicket(void);
void menu_chooseTicket(void);
void menu_BizClass(void);
void menu_EconomyClass(void);
void menu_DepartureBizKL(void);
void menu_DepartureBizLK(void);
void menu_DepartureEconKL(void);
void menu_DepartureEconLK(void);
void menu_ViewSeating(void);
void menu_ChooseDestination(void);
void menu_ChooseTime(void);
void menu_ChooseSeat(void);

int exit_ViewSeating, cust_TicketClass, cust_Destination, cust_Time, cust_Seat;
char MenuSelect,TicketSelect,BizClassSelect,EconomyClassSelect,ViewSeatingSelect;
main()
{
	mainmenu();
}


void mainmenu()
{


	printf("\n\t\t\t\t--WELCOME TO--");
	printf("\n\t\t<<<< AIRLINE RESERVATION SYSTEM >>>> \n");

	printf("\n\n\t\t\t\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
	printf("\n\t\t\t\t%%%%%% Main Menu %%%%%%%\n");
	printf("\t\t\t\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");



	printf("\n\t\t\t\tP to Purchase Ticket\n");
	printf("\n\t\t\t\tV to View Seating Arrangement\n");
	printf("\n\t\t\t\tQ to Quit the system\n\n");
	printf("\n\n\t\t\t\tPlease enter your choice:");
	fflush(stdin);
	MenuSelect = getchar();

	switch(MenuSelect)
	{

		case 'P':
		case 'p':
			menu_PurchaseTicket();
			break;


		case 'V':
		case 'v':

			menu_ViewSeating();
			break;


		case 'Q':
		case 'q':

			printf("Thank you for choosing Airlines Reservation System");
			break;


		default:
			printf("Please enter the correct selection");


	}

}

void menu_PurchaseTicket()
{
	menu_chooseTicket();
	menu_ChooseDestination();
	menu_ChooseTime();
	menu_ViewSeating();
	menu_ChooseSeat();

	int seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat];
	int a,b,c,d;
	for(a=0;a<2;a++)
	{
		if(cust_TicketClass == 0)
			printf("Business Class");
		else
			printf("Economy Class");

		for(b=0;b<2;b++)
		{
			if(cust_Destination == 0)
				printf("Destination: Kuala Lumpur --> Langkawi\n\n");
			else
				printf("Destination: Langkawi --> Kuala Lumpur\n\n");

			for(c=0;c<5;c++)
			{
				switch(cust_Time)
				{
					case '1':
						printf("Departure Time: 9.00 a.m\n");

					case '2':
						printf("Departure Time: 11.00 a.m\n");

					case '3':
						printf("Departure Time: 1.00 p.m\n");

					case '4':
						printf("Departure Time: 3.00 p.m\n");

					case '5':
						printf("Departure Time: 5.00 p.m\n");

					default:
						printf("Please enter the correct selection\n\n");

					for(d=0;d<25;d++)
					{
						if(cust_Seat>25 || cust_Seat<0)
							printf("Invalid Seat Number");

						if(cust_Seat>0 || cust_Seat<25)
							seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat]=1;
					}
				}
			}
		}
	}


}

void menu_chooseTicket()
{

	printf("Please choose your Tciket Class\n\n");
	printf("1 >> Business Class\n\n");
	printf("2 >> Economy Class\n\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_TicketClass);

}

void menu_ChooseDestination()
{

	printf("Please choose destination\n\n");
	printf("1 >> Kuala Lumpur --> Langkawi\n\n");
	printf("2 >> Langkawi --> Kuala Lumpur\n\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_Destination);
}

void menu_ChooseTime()
{

	printf("Please choose flight time\n\n");
	printf("1 >> 9  a.m.\n\n");
	printf("2 >> 11 a.m.\n\n");
	printf("3 >> 1  p.m.\n\n");
	printf("4 >> 3  p.m.\n\n");
	printf("5 >> 5  p.m.\n\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_Time);
}

void menu_ChooseSeat()
{
	printf("Please choose your seat --> ");
	scanf("%d",&cust_Seat);

}


void menu_BizClass()
{

	printf("Destination Menu\n");
	printf("A --> Kuala Lumpur to Langkawi\n");
	printf("B --> Langkawi to Kuala Lumpur\n");
	printf("M --> Return to Main Menu\n");
	printf("Please Enter your Selection -->");
	fflush(stdin);
	BizClassSelect = getchar();

	switch(BizClassSelect)
	{
		case 'a':
		case 'A':
			menu_DepartureBizKL();
			break;

		case 'b':
		case 'B':
			menu_DepartureBizLK();
			break;

		case 'M':
		case 'm':
			mainmenu();
			break;

		default:

			printf("Please enter the correct selection");
			menu_BizClass();
	}



}

void menu_EconomyClass()
{

	printf("Destination Menu\n");
	printf("A --> Kuala Lumpur to Langkawi\n");
	printf("B --> Langkawi to Kuala Lumpur\n");
	printf("M --> Return to Main Menu\n");
	printf("Please Enter your Selection -->");
	fflush(stdin);
	EconomyClassSelect = getchar();

	switch(EconomyClassSelect)
	{
		case 'a':
		case 'A':
			menu_DepartureEconKL();
			break;

		case 'b':
		case 'B':
			menu_DepartureEconLK();
			break;

		case 'M':
		case 'm':
			mainmenu();
			break;

		default:

			printf("Please enter the correct selection");
			menu_EconomyClass();
	}
}

void menu_DepartureBizKL()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Kuala Lumpur --> Langkawi\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_DepartureBizLK()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Langkawi --> Kuala Lumpur\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_DepartureEconKL()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Kuala Lumpur --> Langkawi\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_DepartureEconLK()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Langkawi --> Kuala Lumpur\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_ViewSeating()
{
	int row,col;
	int seats[5][5]={0};
	printf("\t\tSeating In All Flights\n\n");
	printf("\t1\t2\t3\t4\t5\n");
		for (row=0; row<5; row++)
		{
			printf("\n%d", row+1);
			for (col=0; col<5; col++)
			{
				printf("\t%d", seats[row][col]);
			}
		}


	printf("\n\nBusiness Class Seats: 11,12,13,14,15\n\n");
	printf("\n\nEconomy Class Seats: Other than the above\n\n");
}

and here wat we should do :

for booking the it should allow the user to choose destination from four destination and the charge of every destination should be written then they should choose if it is one way or 2 ways then choose the day time and then choose how many passenger and how many of them are adult children infant then allow them to enter them name age passport number and then display the charge for the tickets if there is any adult then 100% of the charge children 60% and infant 10%.but if the user entered c then it should go for cancellation so the user after he enter his passport number should be allowed to cancel his booking with a full charge back but if the cancellation were at the same time then only 60% of the charge and for view data after the user enter his passport number they should display the whole data of the booking

#2

السلام عليكم

عليك بوضع استفسارك باللغة العربية أخي لكي تتم مساعدتك و ألا تخالف قوانين المنتدى.

#3

فى هزا البرنامج اريد ان اضيف بعض الاشياء

اول شى اريد ان يوجد فى البرنامج اربع وجهات وازا كانت زهب او زهب و عودة وتكاليف بعد هزا

يختار عدد الركاب وو كم منهم كبار و كم منهم صغار و كم منهم رضع كما اريد ان يكون المستخدم قادر على ادخال رقم البسبور و تاريخ الميلاد

وبعد ادخال البيانات يقوم بحسب التكاليف التزاكر كا الاتى الكبار 100% من التكاليف

الصغار 60%

الرضع10%من التكاليف

كما اريض ان يكون قادر على الغا الرحلة ازا اراد

sorry for my bad arabic

Eid Mubarak to all of u

i hope u help me soooon

#4

لفد قمت بى بعض التعضيلات فى البرنامج و لاكان لا اعرف ازا كانت صحيحة ام لا

 
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
void mainmenu(void);
void menu_PurchaseTicket(void);
void menu_chooseTicket(void);
void menu_BizClass(void);
void menu_EconomyClass(void);
void menu_DepartureBizDN(void);
void menu_DepartureBizND(void);
void menu_DepartureBizDT(void);
void menu_DepartureBizTD(void);
void menu_DepartureBizDC(void);
void menu_DepartureBizCD(void);
void menu_DepartureBizDP(void);
void menu_DepartureBizPD(void);
void menu_DepartureEconDN(void);
void menu_DepartureEconND(void);
void menu_DepartureEconDT(void);
void menu_DepartureEconTD(void);
void menu_DepartureEconDC(void);
void menu_DepartureEconCD(void);
void menu_DepartureEconDP(void);
void menu_DepartureEconPD(void);
void menu_ViewSeating(void);
void menu_ChooseDestination(void);
void menu_Cancel(void);
void menu_ChooseTime(void);
void menu_ChooseSeat(void);

int exit_ViewSeating, cust_TicketClass, cust_Destination, cust_Time, cust_Seat;
char MenuSelect,TicketSelect,BizClassSelect,EconomyClassSelect,ViewSeatingSelect;
main()
{
	mainmenu();
}


void mainmenu()
{


	printf("\n\t\t\t\t--WELCOME TO--");
	printf("\n\t\t<<<< AIRLINE RESERVATION SYSTEM >>>> \n");

	printf("\n\n\t\t\t\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
	printf("\n\t\t\t\t%%%%%% Main Menu %%%%%%%\n");
	printf("\t\t\t\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");



	printf("\n\t\t\t\tP to Purchase Ticket\n");
	printf("\n\t\t\t\tV to View Seating Arrangement\n");
	printf("\n\t\t\t\tC Cancel\n\n");
	printf("\n\t\t\t\tQ to Quit the system\n\n");
	printf("\n\n\t\t\t\tPlease enter your choice:");
	fflush(stdin);
	MenuSelect = getchar();

	switch(MenuSelect)
	{

		case 'P':
		case 'p':
			menu_PurchaseTicket();
			break;


		case 'V':
		case 'v':

			menu_ViewSeating();
			break;
 	    case 'C':
		case 'c':

			menu_Cancel();
			break;

		case 'Q':
		case 'q':

			printf("Thank you for choosing Airlines Reservation System");
			break;


		default:
			printf("Please enter the correct selection");


	}

}

void menu_PurchaseTicket()
{
	menu_chooseTicket();
	menu_ChooseDestination();
	menu_ChooseTime();
	menu_ViewSeating();
	menu_ChooseSeat();

	int seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat];
	int a,b,c,d,;
	for(a=0;a<2;a++)
	{
		if(cust_TicketClass == 0)
			printf("Business Class");
		else
			printf("Economy Class");

		for(b=0;b<8;b++)
		{
			if(cust_Destination == 0)


 	            printf("Destination: Dubai --> New Dilhe\n\n");
            else
	            printf("Destination: New Dilhe --> Dubai\n\n");
	        else
	            printf("Destination: Dubai --> Tokyo\n\n");
	        else
                printf("Destination: Tokyo --> Dubai\n\n");
            else
                printf("Destination: Dubai --> Cairo\n\n");
            else
                printf("Destination: Cairo --> Dubai\n\n");
            else
                printf("Destination: Dubai --> Paris\n\n");
            else
                printf("Destination: Paris --> Dubai\n\n");
			for(c=0;c<5;c++)
			{
				switch(cust_Time)
				{
					case '1':
						printf("Departure Time: 9.00 a.m\n");

					case '2':
						printf("Departure Time: 11.00 a.m\n");

					case '3':
						printf("Departure Time: 1.00 p.m\n");

					case '4':
						printf("Departure Time: 3.00 p.m\n");

					case '5':
						printf("Departure Time: 5.00 p.m\n");

					default:
						printf("Please enter the correct selection\n\n");

					for(d=0;d<25;d++)
					{
						if(cust_Seat>25 || cust_Seat<0)
							printf("Invalid Seat Number");

						if(cust_Seat>0 || cust_Seat<25)
							seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat]=1;
					}
				}
			}
		}
	}


}

void menu_chooseTicket()
{

	printf("Please choose your Tciket Class\n\n");
	printf("1 >> Business Class\n\n");
	printf("2 >> Economy Class\n\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_TicketClass);

}

void menu_ChooseDestination()
{

	printf("Please choose destination\n\n");
	printf("A --> Dubai to New Dilhe\n");
	printf("B --> New Dilhe to Dubai\n");
	printf("C --> Dubai to Tokyo\n");
    printf("D --> Tokyo to Dubai\n");
    printf("E --> Dubai to Cairo\n");
    printf("F --> Cairo to Dubai\n");
    printf("G --> Dubai to Paris\n");
    printf("H --> Paris to Dubai\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_Destination);
}

void menu_ChooseTime()
{

	printf("Please choose flight time\n\n");
	printf("1 >> 9  a.m.\n\n");
	printf("2 >> 11 a.m.\n\n");
	printf("3 >> 1  p.m.\n\n");
	printf("4 >> 3  p.m.\n\n");
	printf("5 >> 5  p.m.\n\n");
	printf("Please enter your selection --> ");
	fflush(stdin);
	scanf("%d",&cust_Time);
}

void menu_ChooseSeat()
{
	printf("Please choose your seat --> ");
	scanf("%d",&cust_Seat);

}


void menu_BizClass()
{

	printf("Destination Menu\n");
	printf("A --> Dubai to New Dilhe\n");
	printf("B --> New Dilhe to Dubai\n");
	printf("C --> Dubai to Tokyo\n");
    printf("D --> Tokyo to Dubai\n");
    printf("E --> Dubai to Cairo\n");
    printf("F --> Cairo to Dubai\n");
    printf("G --> Dubai to Paris\n");
    printf("H --> Paris to Dubai\n");
	printf("M --> Return to Main Menu\n");
	printf("Please Enter your Selection -->");
	fflush(stdin);
	BizClassSelect = getchar();

	switch(BizClassSelect)
	{
		case 'a':
		case 'A':
			menu_DepartureBizDN();
			break;

		case 'b':
		case 'B':
			menu_DepartureBizND();
			break;

        case 'c':
		case 'C':
             menu_DepartureBizDT();
             break;

        case 'd':
		case 'D':
             menu_DepartureBizTD();
             break;

        case 'e':
		case 'E':
             menu_DepartureBizDC();
             break;

        case 'f':
		case 'F':
             menu_DepartureBizCD();
             break;

        case 'g':
		case 'G':
             menu_DepartureBizDP();
             break;

        case 'h':
		case 'H':
             menu_DepartureBizPD();
             break;

		case 'M':
		case 'm':
			mainmenu();
			break;

		default:

			printf("Please enter the correct selection");
			menu_BizClass();
	}



}

void menu_EconomyClass()
{

	printf("Destination Menu\n");
	printf("A --> Dubai to New Dilhe\n");
	printf("B --> New Dilhe to Dubai\n");
	printf("C --> Dubai to Tokyo\n");
    printf("D --> Tokyo to Dubai\n");
    printf("E --> Dubai to Cairo\n");
    printf("F --> Cairo to Dubai\n");
    printf("G --> Dubai to Paris\n");
    printf("H --> Paris to Dubai\n");
	printf("M --> Return to Main Menu\n");
	printf("Please Enter your Selection -->");
	fflush(stdin);
	EconomyClassSelect = getchar();

	switch(EconomyClassSelect)
	{
		case 'a':
		case 'A':
			menu_DepartureEconDN();
			break;

		case 'b':
		case 'B':
			menu_DepartureEconND();
			break;

        case 'c':
		case 'C':
             menu_DepartureEconDT();
             break;

        case 'd':
		case 'D':
             menu_DepartureEconTD();
             break;

        case 'e':
		case 'E':
             menu_DepartureEconDC();
             break;

        case 'f':
		case 'F':
             menu_DepartureEconCD();
             break;

        case 'g':
		case 'G':
             menu_DepartureEconDP();
             break;

        case 'h':
		case 'H':
             menu_DepartureEconPD();
             break;


		case 'M':
		case 'm':
			mainmenu();
			break;

		default:

			printf("Please enter the correct selection");
			menu_EconomyClass();
	}
}

void menu_DepartureBizDN()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> New Dilhe\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_DepartureBizND()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: New Dilhe --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");

 }

void menu_DepartureBizDT()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Tokyo\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");

 }


void menu_DepartureBizTD()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Tokyo --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	

  }


void menu_DepartureBizDC()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Cairo\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	

 }


void menu_DepartureBizCD()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Cairo --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");
    }


void menu_DepartureBizDP()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Paris\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	
} 

	void menu_DepartureBizPD()
{

	printf("Business Class\n");
	printf("Departure Menu\n");
	printf("Destination: Paris --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	 	

}

void menu_DepartureEconDN()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> New Dilhe\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");


}

void menu_DepartureEconND()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: New Dilhe --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");

 }

void menu_DepartureEconDT()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Tokyo\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");

	}

void menu_DepartureEconTD()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Tokyo --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");
}

void menu_DepartureEconDC()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Cairo\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");
}

void menu_DepartureEconCD()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Cairo --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	
}

void menu_DepartureEconDP()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Dubai --> Paris\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");	
}	
		void menu_DepartureEconPD()
{

	printf("Economy Class\n");
	printf("Departure Menu\n");
	printf("Destination: Paris --> Dubai\n");
	printf("A --> 9.00  a.m\n");
	printf("B --> 11.00 a.m\n");
	printf("C --> 1.00  p.m\n");
	printf("D --> 3.00  p.m\n");
	printf("E --> 5.00  p.m\n");
	printf("Please enter your selection --> ");
}

void menu_ViewSeating()
{
	int row,col;
	int seats[5][5]={0};
	printf("\t\tSeating In All Flights\n\n");
	printf("\t1\t2\t3\t4\t5\n");
		for (row=0; row<5; row++)
		{
			printf("\n%d", row+1);
			for (col=0; col<5; col++)
			{
				printf("\t%d", seats[row][col]);
			}
		}


	printf("\n\nNote: Please choose your seat using row and column format.\n\nFor example:To book seat at row 1 column 3 type 13\n\n");
	printf("\n<< gwen >>\n\n");
	printf("\n\nBusiness Class Seats: 11,12,13,14,15\n\n");
	printf("\n\nEconomy Class Seats: Other than the above\n\n");
}

تم تعديل هذه المشاركة بواسطة gwen في 17 نوفمبر 2010 في 11:54

#5

plz answer

i need that on sunday

#6

کما قلتَ فی رسالة شخصیة المشکل هو:

اقتباس
the problem is i want to make it to make the user choose how many passenger

n how many of them are adult ,children ,infant and calculate the charge of each like

adult 100% of the charge

children 60%

infant 10%

فی رأیی أضف هنا:

void menu_PurchaseTicket()

فی هذا القسم:

                                                if(cust_Seat>0 || cust_Seat<25) 
                                                        seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat]=1;

make here an array to saves age of passenger. then calculate how many of them are adults, childrens and infants.

تحیاتی >)

تم تعديل هذه المشاركة بواسطة u77431 في 18 نوفمبر 2010 في 15:58

#7

c i dont no how to do array cuz it been a month since i start to study programming

#8

هکذا: (أضف هذا فی مکان آخر)

int Passenger_age[cust_ticketclass][cust_destination][cust_time][cust_seat];

و إسئل عن passenger's age و بعد أضف هذا:

                                                if(cust_Seat>0 || cust_Seat<25) 
                                                        seat[cust_TicketClass][cust_Destination][cust_Time][cust_Seat]=1; 
														Passenger_age[cust_ticketclass][cust_destination][cust_time][cust_seat]=age;

اقتباس
i dont no how to do array cuz it been a month since i start to study programming

(فمن کتب هذا؟)

تحیاتی

>)

تم تعديل هذه المشاركة بواسطة u77431 في 18 نوفمبر 2010 في 16:51

#9

its a project at the school

every 5 student in 1 group so i did that with my friend but we dont no how to do the calculating

but thnx that mean alot to me

مواضيع مشابهة