注册 登录
编程论坛 C++教室

有没有更好的飞机订票程序啊

lgylhw 发布于 2010-03-20 10:14, 534 次点击
#include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;


class Flight
{
protected:
   
    char  name[20];
    char   ID[20];
    int   number[10][5];
public:
    void input();
    void print();
    //{
    //    cout<<"名字"<<name<<endl;
    //    cout<<"身份证"<<ID<<endl;
    //    cout<<"号码"<<number<<endl;
    //}
    //void list_menu();
    //void list_information();
    void bookticket();
    void deleteticket();
};

void main()
{
    int j;
   cout<<"============================================================";
       do
       {
         cout<<"---------*  1.输入信息     *------------------------"<<endl;
         cout<<"---------*  2.输出信息     *------------------------"<<endl;
         cout<<"---------*  3.定机票       *------------------------"<<endl;
         cout<<"---------*  4.退机票       *------------------------"<<endl;
         cout<<"---------*  0.退出         *------------------------"<<endl;

    cout<<"============================================================"<<endl;
    cout<<"请在0-4选择以回车键结束: ";
    cin>>j;
    if(j==1) input();//调用输入模块
    if(j==2) iprint();
    if(j==3) booktcket();
    if(j==4) deleteticket();
    if(j==0) break;
}while(j!='0');   //判断结束
cout<<"谢谢使用,再见! ";
}

void::input()
{
    int i,j;
    int number[10][5];
    cout<<"please input the number: ";
    for(i=0;i<10;i++)
    {
        for(j=0;j<5;j++)
        {
            cout<<number[10][5];
        }
    }

4 回复
#2
hahayezhe2010-03-20 10:21
    if(j==1) input();//调用输入模块
    if(j==2) iprint();
    if(j==3) booktcket();
    if(j==4) deleteticket();
    if(j==0) break;
你居然这么用。。。
void bookticket();
    void deleteticket();
程序代码都没得
居然还用的protected:??私有?保护程序?类的构建都是错的

完全的错哦!
#3
wandison2010-03-21 13:43
程序能运行?
#4
vincentfon2010-03-25 17:55
这样的问题,我只能回答。有。...
#5
风行2010-03-26 04:27
用派生类做吧
1