诊所信息管理系统

1. 诊所信息管理系统

1.1 问题描述

题目描述:

设计完成小型诊所的简单信息管理程序

功能需求:

(1)设计人类(Person类)和医生类(Doctor 类),在此基础上,通过增

加患者和账单,使它们公用于表示一家诊所的信息管理。(2)在一条医生记录中,包括医生的专业说明(specialty),如内科医生(surgeon)、儿科医生(pediatrician) 、产科医生(obstetrician)及全科医生(general practitioner)。

(3) Doctor 记录还含有诊费 (office vist fee)。

(4)在一条患者记录中,包括该患者产生的药费(drug fee),患者的诊费(即医生的诊费)。

(5)在一条账单记录中,包括一条患者对象、该患者对应得主治医生、该患者产生的诊费和药费。

(6)应用程序能够显示出诊所中每个患者的信息和对应主治医生的信息(7)能够统计出所有患者的总费用。

进阶:增加医生专家和普诊挂号费不同,医保卡打折功能。

1.2 解题思路

1.2.1 类设计

分别定义了person人类、doctor医生类、HuanZhe患者类以及帐单类;在person人类中,包含了数据成员姓名(name)、性别(sex)、年龄(age)以及诊费(office_vist_fee);在doctor医生类中,增加了数据成员医生的专业说明(drug_fee),包含了成员函数input()增加医生信息,zhangdanKind()按姓名查询医生信息;在HuanZhe患者类中,增加了数据成员患者的药费(drug_fee),包含了成员函数input()增加患者信息,zhangdanKind()按姓名查询患者信息;在zhangdan帐单类中,包含了数据成员姓名(name)、诊费(office_vist_fee)、药费(drug_fee)、总费用(totl_fee),包含了成员函数totl_pay()用于把总费用从"D:\\bb.txt"文件移到"D:\\cc.txt",pay()统计该系统中所有患者的总费用,addzhangdan()增加账单信息,zhangdanKind()按姓名查询账单信息。

1.2.2 类之间的关系

在该系统中医生与患者都有数据成员姓名(name)、性别(sex)、年龄(age)以及诊费(office_vist_fee);所以把这些数据成员定义在基类person人类中,doctor医生类与HuanZhe患者类公有继承于基类person人类。

1.2.3 函数设计

在doctor医生类中,包含了成员函数input()增加医生信息,zhangdanKind()按姓名查询医生信息;在HuanZhe患者类中,包含了成员函数input()增加患者信息,zhangdanKind()按姓名查询患者信息;在zhangdan帐单类中,包含了成员函数totl_pay()用于把总费用从"D:\\bb.txt"文件移到"D:\\cc.txt",pay()统计该系统中所有患者的总费用,addzhangdan()增加账单信息,zhangdanKind()按姓名查询账单信息。在该系统中,还包含了普通函数addinfor()增加信息界面实现,select()查询信息界面实现,zhangdanxinxi() 账单信息界面实现,add_zhuce()实现注册用户,welcome()验证用户登陆,登陆成功显示欢迎信息,Please()诊所信息管理系统主界面的实现。

1.2.2 结构设计

1.2.2.1 系统流程图

图2.1 系统流程图

1.2.2.2 界面设计

addinfor()增加信息界面包括了1. 增加医生信息2. 增加患者信息0. 退出;

select()查询信息界面包括了1. 查询医生信息2. 查询患者信息0. 退出;

zhangdanxinxi() 账单信息界面包括了1. 增加账单信息2. 查询账单信息0. 退出;

Please()诊所信息管理系统主界面包括了1.查询信息2.账单信息3.增加信息4.统计总费用0.退出系统;

main()主函数界面包括了1.用户登录2.用户注册0.退出系统。在这些界面的实现中用switch()语句做选择。

1.3 程序设计

3.1 类实现

class person  //人类

{

protected:

   string name;

   char sex;

   int age;

   double office_vist_fee;

public:

   person() {}

   ~person() {}

};

class doctor : public person   //医生类

{

private:

   char speicialty[15];

public:

   doctor() {}

   void input(); //增加医生信息

   void zhangdanKind() ; //按姓名查询医生信息

   ~doctor() {}

};

class HuanZhe : public person  //患者类

{

private:

   double drug_fee;                                       

public:

   HuanZhe(){}

   void input() ; //增加患者信息

   void zhangdanKind();  //按姓名查询患者信息

   ~HuanZhe()  {}

};

class zhangdan    //帐单类

{

   string name;

   double drug_fee;

   double office_vist_fee;

   double totl_fee;

public:

   zhangdan()  { }

   void totl_pay() ; //用于把总费用从"D:\\bb.txt"文件移到"D:\\cc.txt"

void pay() ;     //实现统计所有患者总费用

   void zhangdanKind() ;//按姓名查询账单信息

   ~zhangdan() {}

};

3.2 主函数实现

void main()//主函数

{

   //system("color 3F");

   int w;

   cout<<"\t\t☆********★**********☆***********★********☆\n";

   cout<<"\t\t★                                           ★\n";

   cout<<"\t\t☆                                           ☆\n";

   cout<<"\t\t★               1.用户登录                  ★\n";

   cout<<"\t\t☆               2.用户注册                  ☆\n";

   cout<<"\t\t★               0.退出系统                  ★\n";

   cout<<"\t\t☆                                           ☆\n";

   cout<<"\t\t★                                           ★\n";

   cout<<"\t\t☆★☆★☆★**********☆***********★☆★☆★☆\n";

   while(1)

   {

      cout<<"请输入数字<0-2>:"; 

      cin>>w;

      switch(w)

      {

      case 1:Please(); break;

      case 2:add_zhuce(); break;

      case 0:exit(0);

        default: cout<<"输入数字错误!"<<endl;

      }

   }

}

3.3 模块设计

增加医生信息如图3.1所示

图3.1 增加医生信息函数流程图图

按姓名查询医生信息如图3.2所示

图3.2 按姓名查询医生信息函数流程图

账单类如图3.3所示

图3.3 账单函数

统计所有患者总费用如图3.4所示

图3.4 统计所有患者总费用函数

增加账单信息如图3.5所示

图3.5 增加账单信息函数

实现注册用户如图3.6所示

图3.6 实现注册用户

按姓名查询账单如图3.7所示

图3.7按姓名查询账单函数

验证用户登陆,登陆成功显示欢迎信息如图3.8所示

图3.8 登录成功显示欢迎函数

1.4 测试结果

1.用户注册与登陆

(1)用户注册界面如图4.1所示。

图 4.1

(2)用户登陆界面如图4.2所示。

图 4.2

2.诊所信息管理系统主界面如图4.3所示。

图 4.3

3.增加信息界面如图4.4所示。

图 4.4

(1)增加医生信息如图4.5所示。

图4.5

(2)增加患者信息如图4.6所示。

图 4.6

4.查询信息界面如图4.7所示。

图 4.7

(1)查询医生信息如图4.8所示。

图 4.8

(2)查询患者信息如图4.9所示。

图 4.9

5.帐单信息界面如图4.10所示。

图 4.10

(1)增加帐单信息如图4.11所示。

图 4.11

(2)查询帐单信息如图4.12所示。

图 4.12

6.统计功能实现如图4.13所示。

图 4.13

(7)退出系统界面如图4.14所示。

图4.14

2.结论与心得

C++课程设计的训练,我学到了很多,最主要的一点是怎样去运用自己学过的知识,怎样去找到你所需要的资料,并在短时间把它运用到具体的实践中,运用到你所需要的方面。这个过程是很艰难的,要花费很多的时间和精力,但是,在事情过后,自己就会发现自己已经在这个过程中学到了自己想要的东西,这种获得是更深刻的。

在做这个C++课程设计的时候,我原先也是学的不怎么好,什么是结构体数据,什么是定义类型,怎样在一个main函数中调用别的定义函数,等等,可以说是忘得差不多了。然而,在这门课程设计中,这些方面却是特别重要的,可以说,掌握了这个,你就完全可以完成自己的任务。这就要求我们要自己去学,自己去探索。当然,看书、问同学是必不可少的,还有,身边有非常丰富的网络资源给我们好好利用,百度就是个很不错的地方。这样就从另一方面锻炼了我们检索知识获取信息的能力,在这个过程中,可以学到的是一种提升自我的能力。

当然,由于个人能力所限,这份课程设计有一些别的方面还是要参考人家的的资料,在读懂别人材料的同时,自己取人所长,补己之短,经过多次的调试,总结,最后交出一份自己比较满意的答卷。

在本次课程设计中,我发现我对知识的运用不是那么准确,也就是说我对知识掌握的不够熟练。课本上有的知识却不会运用,虽然在本次C++课程设计中,显示出一些我知识上的漏洞,经过这次编写诊所信息管理系统,我发现我熟练掌握了类的定义以及继承与派生,并对文件操作有了初步的掌握,课下还应该继续努力,争取熟练掌握一门编程设计语言,在次基础上,在学习多种编程语言,以便以后可以用到工作中去。

通过这次的课程设计,终于我的诊所信息管理系统完美告终,让我进一步的了解到C++在我们日常生活中的重要性,而且,也更进一步的激发了我学习这门语言的兴趣.经过这次的训练,我相信自己以后会用更多的时间来把这门语言学好,掌握好这门必修的基础语言。

3.参考文献

[1]李素若,杜华兵编,C++面向对象程序设计.中国水利水电出版社.2013年.

[2]谭浩强编,C++面向对象程序设计.北京:清华大学出版社,2006年.

[3]安志远,贾振华主编,C++程序设计基础.北京:高等教育出版社,2009.6

[4]王超,C++程序设计.北京:地质出版社,2006.82

[5]王继明,C++程序设计与应用开发[M].北京:清华出版社,2008.

附录 源程序代码

#include <iostream>

#include <string.h>

#include <string>

#include <fstream>

#include <cmath>

using namespace std;

class person  //人类

{

protected:

    string name;

    char sex;

    int age;

    double office_vist_fee;

public:

    person() {}

    ~person() {}

};

class doctor : public person   //医生类

{

private:

    char speicialty[15];

public:

    doctor() {}

    void input()  //增加医生信息

    {

        char t;

        cout<<"*****主治医生基本信息*****"<<endl;

        fstream outfile("D:\\aa.txt",ios::out|ios::app);  //以写方式打开文件

        if(! outfile)

            cout<<"打开文件失败!"<<endl;

        else

        {

            cout<<"姓名:";

            cin>>name; outfile<<name<<"  ";

            cout<<"性别:"; cin>>sex;

            if(sex=='m'||sex=='M')

                outfile<<"男"<<"  ";

            else if(sex=='f'||sex=='F')

                outfile<<"女"<<"  ";

            else

            {

                cout<<"请重新输入性别:"; 

                cin>>sex;

                if(sex=='m'||sex=='M')

                    outfile<<"男"<<"  ";

                else if(sex=='f'||sex=='F')

                    outfile<<"女"<<"  ";

            }

            cout<<"年龄:";

            cin>>age;  outfile<<age<<"  ";

            cout<<"诊费:";

            cin>>office_vist_fee; outfile<<office_vist_fee<<"  ";

            cout<<"专业说明:";

            cin>>speicialty; outfile<<speicialty<<endl;

            outfile.close();

        }

        cout<<"是否继续添加医生信息Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            input();

        else

            return;

    }

    void zhangdanKind()   //按姓名查询医生信息

    {

        char t;

        fstream infile2("D:\\aa.txt",ios::in);   //以读方式打开文件

        if(! infile2)

        {

            cout<<"打开文件失败!"<<endl;

            return ;

        }

        int line=0;

        string arr[100][100];  //定义一个string类型的二维数组,用来保存从文本内读取的信息

        memset(arr,0,sizeof(arr));   //将数组清空

        while(!infile2.eof())   //文件不为空的条件设置

        {

            infile2>>arr[line][0]>>arr[line][1]>>arr[line][2]>>arr[line][3]>>arr[line][4];

            line++;

        }

        string na;

        cout<<"请输入要查询的医生姓名:";

        cin>>na;

        for(int i=0;i<line;i++)

        {

            if(arr[i][0]==na)

            {

                cout <<"医生姓名:"<<arr[i][0] <<"  "<<"性别:"<<arr[i][1]<<"  " <<"年龄:"<<arr[i][2]<<"  "

                    <<"诊费:"<<arr[i][3]<<"元"<<"  "<<"专业:"<<arr[i][4]<<endl;

                return;

            }

        }

        cout<<"记录中没有此医生信息!"<<endl;

        cout<<"是否继续查询Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            zhangdanKind();

        else

            return;

    }

    ~doctor() {}

};

class HuanZhe : public person  //患者类

{

private:

    double drug_fee;                                       

public:

    HuanZhe()

    {}

    void input()   //增加患者信息

    {

        char t;

        cout<<"*****患者基本信息*****"<<endl;

        fstream outfile("D:\\ee.txt",ios::out|ios::app);  //以写方式打开文件

        if(! outfile)

            cout<<"打开文件失败!"<<endl;

        else

        {

            cout<<"姓名:";

            cin>>name; outfile<<name<<"  ";

            cout<<"性别:"; cin>>sex;

            if(sex=='m'||sex=='M')

                outfile<<"男"<<"  ";

            else if(sex=='f'||sex=='F')

                outfile<<"女"<<"  ";

            else

            {

                cout<<"请重新输入性别:"; 

                cin>>sex;

                if(sex=='m'||sex=='M')

                    outfile<<"男"<<"  ";

                else if(sex=='f'||sex=='F')

                    outfile<<"女"<<"  ";

            }

            cout<<"年龄:";

            cin>>age;  outfile<<age<<"  ";

            cout<<"诊费:";

            cin>>office_vist_fee; outfile<<office_vist_fee<<"  ";

            cout<<"药费:";

            cin>>drug_fee; outfile<<drug_fee<<endl;

            outfile.close();

        }

        cout<<"是否继续添加患者信息Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            input();

        else

            return;

    }

    void zhangdanKind()   //按姓名查询患者信息

    {

        char t;

        fstream infile2("D:\\ee.txt",ios::in);  //以读方式打开文件

        if(! infile2)

        {

            cout<<"打开文件失败!"<<endl;

            return ;

        }

        string arr[100][100];   //定义一个string类型的二维数组,用来保存从文本内读取的信息

        int line=0;

        memset(arr,0,sizeof(arr));  将数组清空

        while(!infile2.eof())  //文件不为空的条件设置

        {

            infile2>>arr[line][0]>>arr[line][1]>>arr[line][2]>>arr[line][3]>>arr[line][4]; //文件流读取数据

            line++;

        }

        string na;

        cout<<"请输入要查询的患者姓名:";

        cin>>na;

        for(int i=0;i<line;i++)

        {

            if(arr[i][0]==na)

            {

                cout <<"患者姓名:"<<arr[i][0] <<"  "<<"性别:"<<arr[i][1]<<"  "<<"年龄:"<<arr[i][2]<<"  "

                    <<"诊费:"<<arr[i][3]<<"元"<<"  "<<"药费:"<<arr[i][4]<<"元"<<endl;

                return;

            }

        }

        cout<<"记录中没有此患者的信息!"<<endl;

        cout<<"是否继续查询Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            zhangdanKind();

        else

            return;

    }

    ~HuanZhe()  {}

};

class zhangdan    //帐单类

{

    string name;

    double drug_fee;

    double office_vist_fee;

    double totl_fee;

public:

    zhangdan()  { }

    void totl_pay()   //用于把总费用从"D:\\bb.txt"文件移到"D:\\cc.txt"

    {

        string a;

        fstream infile1("D:\\bb.txt",ios::in); //以读方式打开文件

        if(! infile1)

        {

            cout<<"打开文件失败!"<<endl;

            return ;

        }

        string arr[100][100];   //定义一个string类型的二维数组,用来保存从文本内读取的信息

        int line=0;

        memset(arr,0,sizeof(arr));  //将数组清空

        while(!infile1.eof())   //文件不为空的条件设置

        {

            infile1>>arr[line][0]>>arr[line][1]>>arr[line][2]>>arr[line][3]>>arr[line][4];  //文件流读取数据

            line++;

        }

        for(int i=0;i<line;i++)

        {

            fstream outfile4("D:\\cc.txt",ios::out|ios::app);   //以写方式打开文件

            if(! outfile4)

                cout<<"打开文件失败!"<<endl;

            else

                a=arr[i][4];

            outfile4<<a<<endl;

            outfile4.close();

        }

        infile1.close();

    }

    void pay()       //实现统计所有患者总费用

    {

        double a;

        double z=0.0;

        fstream infile4("D:\\cc.txt",ios::in); //以读方式打开文件

        if(! infile4)

        {

            cout<<"打开文件失败!"<<endl;

            return ;

        }

        double s[100];

        int line=0;

        while(!infile4.eof())   //文件不为空的条件设置

        {

            infile4>>s[line];  //文件流读取数据

            line++;

        }

        for(int i=0;i<line-1;i++)

        {

            a=s[i];

            z=z+a;

        }

        cout<<"所有患者的总费用为:"<<z<<"元"<<endl;

        infile4.close();

    }

    void addzhangdan() // 增加账单信息

    {

        fstream outfile3("D:\\bb.txt",ios::out|ios::app);  //以写方式打开文件

        if(! outfile3)

            cout<<"打开文件失败!"<<endl;

        else

        {

            cout<<"患者姓名:"; 

            cin>>name;  outfile3<<name<<"  ";

            cout<<"主治医生:"; 

            cin>>name;  outfile3<<name<<"  ";

            cout<<"诊费:";

            cin>>office_vist_fee; outfile3<<office_vist_fee<<"  ";

            cout<<"药费:";

            cin>>drug_fee; outfile3<<drug_fee<<"  ";

            cout<<"总费用:";

            cin>>totl_fee; outfile3<<totl_fee<<endl;

            outfile3.close();

        }

        char t;

        cout<<"是否继续添加账单信息Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            addzhangdan();

        else

            return;

    }

    void zhangdanKind()  //按姓名查询账单信息

    {

        char t;

        fstream infile1("D:\\bb.txt",ios::in);  //以读方式打开文件

        if(! infile1)

        {

            cout<<"打开文件失败!"<<endl;

            return ;

        }

        string arr[100][100];  //定义一个string类型的二维数组,用来保存从文本内读取的信息

        int line=0;

        memset(arr,0,sizeof(arr));  //将数组清空

        while(!infile1.eof())   //文件不为空的条件设置

        {

            infile1>>arr[line][0]>>arr[line][1]>>arr[line][2]>>arr[line][3]>>arr[line][4];  //文件流读取数据

            line++;

        }

        string na;

        cout<<"请输入要查询的患者姓名:";

        cin>>na;

        for(int i=0;i<line;i++)

        {

            if(arr[i][0]==na)

            {

                string xm;

                xm=arr[i][1];

                cout <<"患者姓名:"<<arr[i][0] <<"  "<<"医生姓名:"<<arr[i][1]<<"  " <<"诊费:"<<arr[i][2]<<"元"<<"  "

                <<"药费:"<<arr[i][3]<<"元"<<"  "<<"总费用:"<<arr[i][4]<<"元"<<endl;

                fstream infile2("D:\\aa.txt",ios::in);  //以读方式打开文件

                if(! infile2)

                {

                    cout<<"打开文件失败!"<<endl;

                    return ;

                }

                int l=0;

                memset(arr,0,sizeof(arr));  //将数组清空

                while(!infile2.eof())   //文件不为空的条件设置

                {

                   infile2>>arr[l][0]>>arr[l][1]>>arr[l][2]>>arr[l][3]>>arr[l][4];  //文件流读取数据

                    l++;

                }

               for(int j=0;j<l;j++)

               {

                   if(arr[j][0]==xm)

                   {

                        cout <<"医生姓名:"<<arr[j][0] <<"  "<<"性别:"<<arr[j][1]<<"  " <<"年龄:"<<arr[j][2]<<"  "

                        <<"诊费:"<<arr[j][3]<<"  "<<"专业:"<<arr[j][4]<<endl;

                   }

               }

               fstream infile3("D:\\ee.txt",ios::in);  //以读方式打开文件

               if(! infile3)

               {

                 cout<<"打开文件失败!"<<endl;

                 return ;

               }

               int lin=0;

               memset(arr,0,sizeof(arr));  //将数组清空

               while(!infile3.eof())  //文件不为空的条件设置

               {

                infile3>>arr[lin][0]>>arr[lin][1]>>arr[lin][2]>>arr[lin][3]>>arr[lin][4]; //文件流读取数据

                lin++;

               }

               for(int z=0;z<lin-1;z++)

               {

                    if(arr[i][0]==na)

                    {

                        cout <<"患者姓名:"<<arr[z][0] <<"  "<<"性别:"<<arr[z][1]<<"  " <<"年龄:"<<arr[z][2]<<"  "

                        <<"诊费:"<<arr[z][3]<<"  "<<"药费:"<<arr[z][4]<<endl;

                    }

               }

               return;

            }

        }

        cout<<"记录中没有此患者的帐单信息!"<<endl;

        cout<<"是否继续查询Y/N......:"<<endl;

        cin>>t;

        if(t=='y')

            zhangdanKind();

        else

            return;

    }

    ~zhangdan() {}

};

void add_zhuce()        //实现注册用户

{

    string name,code,code1;

    fstream outfile5("D:\\dd.txt",ios::out|ios::app);  //以写方式打开文件

    if(! outfile5)

            cout<<"打开文件失败!"<<endl;

    else

    {

        cout<<"☆********★请注册用户★********☆\n";

        cout<<"请输入您的用户名:"; 

        cin>>name;

        fstream infile6("D:\\dd.txt",ios::in);  //以读方式打开文件

        if(! infile6)

        {

            cout<<"打开文件失败!"<<endl;

            return;

        }

        string a[100][2];  //定义一个string类型的二维数组,用来保存从文本内读取的信息

        int line=0;

        memset(a,0,sizeof(a));  //将数组清空

        while(!infile6.eof())   //文件不为空的条件设置

        {

            infile6>>a[line][0]>>a[line][1];  //文件流读取数据

            line++;

        }

        for(int i=0;i<line;i++)

        {

            if(a[i][0]==name)

            {

                cout<<"此用户已存在!谢谢使用本系统注册用户界面!欢迎下次使用!"<<endl;

                exit(0);

            }      

        }

        outfile5<<name<<"  ";

        cout<<"请输入您的密码:";

        cin>>code;

        cout<<"请再次输入您的密码:";

        cin>>code1;

        if(code!=code1)

        {

            cout<<"您两次输入的密码不一致!谢谢使用本系统注册用户界面!欢迎下次使用!"<<endl;

            exit(0);

        }

        else

            outfile5<<code1<<endl;

    }

    cout<<"谢谢使用本系统注册用户界面!您已注册成功!"<<endl;

    outfile5.close();

}

void welcome()     //验证用户登陆,登陆成功显示欢迎信息

{

    string name,code;

    int mark=0; 

    fstream infile("D:\\dd.txt",ios::in);

    if(!infile)

    {

        cerr<<"打开文件错误"<<endl;

        return;

    }

       int line=0;

       string a[100][100];

       memset(a,0,sizeof(a));  //将数组清空

       while(!infile.eof())              //文件不为空的条件设置

       {

         infile>>a[line][0]>>a[line][1];  //文件流读取数据 

         line++;

       }

      cout<<"\t\t☆********★用户名☆********★:";

      cin>>name;

      int m=-1;

      for(int i=0;i<line;i++)

      {

         if(a[i][0]==name)

         {

            m=i;

            mark=i;

            break;

         }

      }

      if(m==-1)

      {

          cout<<"\t\t☆********★该用户不存在,请注册用户☆********★"<<endl;

          add_zhuce();

      }

      cout<<"\t\t☆********★密码☆********★:";

      cin>>code;

      for(int j=0;j<2;j++)

      {

          if(a[mark][1]==code)

          {

              cout<<"成功登入☆********★"<<endl;

              break;

          }

          else

          {

              cout<<"密码错误,请重新输入☆********★"<<endl;

              cout<<"\t\t☆********★密码☆********★:";

              cin>>code;

          }

     }

}

void addinfor() //增加信息界面实现

{

    int a;

    doctor d;

    HuanZhe w;

    cout<<endl;

    cout<<endl;

    cout<<"\t\t      ★********增加信息界面*********★"<<endl;

    cout<<"\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆        1. 增加医生信息           ☆\n";

    cout<<"\t\t    ☆        2. 增加患者信息           ☆\n";

    cout<<"\t\t    ☆        0. 退出                   ☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"请输入您选择的数字<0-2>:";

    cin>>a;

    switch(a)

    {

        case 1: d.input(); break;

        case 2: w.input(); break;

        case 0: break;

        default: cout<<"输入数字错误!"<<endl;

    }

}

void select() //查询信息界面实现

{

    int b;

    doctor d;

    HuanZhe w;

    cout<<endl;

    cout<<endl;

    cout<<"\t\t      ★********查询信息界面*********★"<<endl;

    cout<<"\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆        1. 查询医生信息           ☆\n";

    cout<<"\t\t    ☆        2. 查询患者信息           ☆\n";

    cout<<"\t\t    ☆        0. 退出                   ☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"请输入您选择的数字<0-2>:";

    cin>>b;

    switch(b)

    {

        case 1: d.zhangdanKind(); break;

        case 2: w.zhangdanKind(); break;

        case 0: break;

        default: cout<<"输入数字错误!"<<endl;

    }

}

void zhangdanxinxi() //账单信息界面实现

{

    int c;

    zhangdan z;

    cout<<endl;

    cout<<endl;

    cout<<"\t\t         ★********账单信息*********★"<<endl;

    cout<<"\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆        1. 增加账单信息           ☆\n";

    cout<<"\t\t    ☆        2. 查询账单信息           ☆\n";

    cout<<"\t\t    ☆        0. 退出                   ☆\n";

    cout<<"\t\t    ★                                  ★\n";

    cout<<"\t\t    ☆********★**************★********☆\n";

    cout<<"请输入您选择的数字<0-3>:";

    cin>>c;

    switch(c)

    {

        case 1: z.addzhangdan(); break;

        case 2: z.zhangdanKind(); break;

        case 0: break;

        default: cout<<"输入数字错误!"<<endl;

    }

}

void Please()   //诊所信息管理系统主界面的实现

{

    welcome(); //验证用户登陆,登陆成功显示欢迎信息

    int chiose;

    cout<<"\n\n";

    while(1)

    {

        cout<<"\t\t ★**★**☆欢迎使用诊所信息管理系统☆**★**★"<<endl;

        cout<<"\n";

        cout<<"\t\t☆********★**********☆***********★********☆\n";

        cout<<"\t\t★                                           ★\n";

        cout<<"\t\t☆                                           ☆\n";

        cout<<"\t\t★     1.查询信息          2.账单信息        ★\n";

        cout<<"\t\t☆     3.增加信息          4.统计总费用      ☆\n";

        cout<<"\t\t★               0.退出系统                  ★\n";

        cout<<"\t\t☆                                           ☆\n";

        cout<<"\t\t★                                           ★\n";

        cout<<"\t\t☆★☆★☆★**********☆***********★☆★☆★☆\n";

        zhangdan a;

        cout<<"请输入您选择的数字<0-4>:";

        cin>>chiose;

        switch(chiose)

        {

        case 1: select(); break;

        case 2: zhangdanxinxi(); break;

        case 3: addinfor(); break;

        case 4: a.totl_pay(); a.pay(); break;

        case 0: cout<<"\t\t☆★☆★☆★☆欢迎下次使用本系统☆★☆★☆★☆"<<endl; exit(0);

        default: cout<<"输入数字错误!"<<endl;

        }

    }

}

void main()//主函数

{

    //system("color 3F");

    int w;

    cout<<"\t\t☆********★**********☆***********★********☆\n";

    cout<<"\t\t★                                           ★\n";

    cout<<"\t\t☆                                           ☆\n";

    cout<<"\t\t★               1.用户登录                  ★\n";

    cout<<"\t\t☆               2.用户注册                  ☆\n";

    cout<<"\t\t★               0.退出系统                  ★\n";

    cout<<"\t\t☆                                           ☆\n";

    cout<<"\t\t★                                           ★\n";

    cout<<"\t\t☆★☆★☆★**********☆***********★☆★☆★☆\n";

    while(1)

    {

        cout<<"请输入数字<0-2>:"; 

        cin>>w;

        switch(w)

        {

        case 1:Please(); break;

        case 2:add_zhuce(); break;

        case 0:exit(0);

        default: cout<<"输入数字错误!"<<endl;

        }

    }

}

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小柒_02

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值