C 语言医院管理系统

2024年8月28日 | 阅读 18 分钟

我利用了 fopen、fread、fwrite 等文件相关函数来处理 C 语言中的文件,作为此程序的基础。“医院管理系统项目”受密码保护,这很好,因为它确保只有授权用户才能访问此程序。

我将程序划分为不同的函数,使其更易于阅读。每个项目函数都大量使用了文件处理函数,这使其成为学习 C 语言文件处理的绝佳项目。

程序分解

以上代码是记录的结构。

以上是我们医院管理中的功能。

以上代码将提供系统的接口。

以上代码将用于在系统中添加数据。

要查看患者的详细信息,以上代码将有所帮助。

以上代码将帮助编辑记录。

以上代码将帮助搜索记录。

以上代码将用于删除系统中的记录。

以上代码将读取文件。

以上代码将用于写入文件。

C 语言医院管理系统程序

输出

Simple Hospital Management System
     * * * * * * * *
        * *
        * *
        * *
* * Enter your choice * *
1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit
Option=1


Already data inputed on the database =4

How many entry do you want to add=
2

Enter patient's Name = Ravi
Enter disease = Typhoid
Enter the age = 34
Enter cabin no = 12
Enter phone number = 4356432466

Enter patient's Name = Sumantra
Enter disease = Dengue
Enter the age = 32
Enter cabin no = 13
Enter phone number = 8767895686

* * Enter your choice * *

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option=3
By what do you want to search ?
1.Serial no.
2.Name
3.Disease
4.Cabin no.
5.Phone no.
6.Age

Option = 2
Enter your name=Ravi

Serial Number=4
Name = Ravi
Disease = Typhoid
Cabin no = 12
Phone number = 061465170
Age = 34



**Enter your choice**

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option= 4
What do you want to edit ?
Enter your option
1.Name
2.Disease
3.Age
4.Cabin
5.Phone no.
Option=3
Enter the serial no of that patient= (0 - 5)=1
Enter the new Age=35

*  * Enter your choice * *

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option=4
What do you want to edit ?
Enter your option
1.Name
2.Disease
3.Age
4.Cabin
5.Phone no.
Option=1
Enter the serial no of that patient= (0 - 5)=1
Enter the new name=Ravi Tiwari

*  * Enter your choice *  *

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option= 3
By what do you want to search ?
1.Serial no.
2.Name
3.Disease
4.Cabin no.
5.Phone no.
6.Age

Option = 2
Enter your name=Ravi Tiwari

Serial Number=1
Name = Ravi Tiwari
Disease = Fever
Cabin no = 2
Phone number = 01657569852
Age = 35

* * Enter your choice * *

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option=5
Enter the serial number of the patient that you want to delete=2
What do you want ?
1.Remove the whole record
2.Remove Name
3.Remove Disease
4.Remove age
5.Remove Cabin
6.Remove phone number
Option = 4


**Enter your choice**

1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit

Option= 5
Enter the serial number of the patient that you want to delete=1
What do you want ?
1.Remove the whole record
2.Remove Name
3.Remove Disease
4.Remove age
5.Remove Cabin
6.Remove phone number
Option = 1
* * Enter your choice * *
1. Add Information
2. View Information
3. Search
4. Edit Information
5. Delete Information
6. Exit
Option= 6