قسم الميكروكنترولر والروبوت ودوائر الاتصال بالحاسب الالي قسم المتحكمات الـ microcontroller و المعالجات microprocessor و التحكم الرقمي بالكمبيوتر CNC والانظمة الآلية والروبوت Robots

أدوات الموضوع

gwen
:: مهندس ::
تاريخ التسجيل: Nov 2010
المشاركات: 2
نشاط [ gwen ]
قوة السمعة:0
قديم 18-11-2010, 01:25 PM المشاركة 1   
افتراضي خبراء لغة helppppppppp C Twitter FaceBook Google+



كود:
#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 --> ");             
        
}

اعلانات

gwen
:: مهندس ::
تاريخ التسجيل: Nov 2010
المشاركات: 2
نشاط [ gwen ]
قوة السمعة:0
قديم 18-11-2010, 01:27 PM المشاركة 2   
افتراضي


[code]
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\nBusiness Class Seats: 11,12,13,14,15\n\n");
printf("\n\nEconomy Class Seats: Other than the above\n\n");
}
[code/]

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

اعلانات اضافية ( قم بتسجيل الدخول لاخفائها )
  

ahmeedzeki
:: مهندس ::
تاريخ التسجيل: Oct 2010
المشاركات: 34
نشاط [ ahmeedzeki ]
قوة السمعة:0
قديم 20-11-2010, 08:27 AM المشاركة 3   
افتراضي


السلام عليكم
لم افهم القصد هل هذا برنامج مطارات او ماذا؟؟؟
ارجو التوضيح للرد عليكم
و شكرا

إضافة رد

العلامات المرجعية

«     الموضوع السابق       الموضوع التالي    »
أدوات الموضوع

الانتقال السريع إلى


الساعة معتمدة بتوقيت جرينتش +3 الساعة الآن: 11:19 AM
موقع القرية الالكترونية غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي موقع القرية الالكترونية ولايتحمل الموقع أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)

Powered by vBulletin® Version 3.8.6, Copyright ©2000 - 2025