进行一个图书管理系统设计 图书管理信息包括:图书名称、图书编号、单价、作者、存在状态、借书人姓名、性别、学号等 功能描述: 1、新进图书基本信息的输入。 2、图书基本信息的查询。 3、对撤消图书信息的删除。 4、为借书人办理注册。 5、办理借书手续。 6、办理还书手续 要求:使用文件方式存储数据。
时间: 2023-03-06 22:53:42 浏览: 82
对于要求的图书管理系统设计,首先要考虑到图书管理信息的存储,图书信息可以使用文件方式存储,如txt文件或数据库文件,其中包含图书名称、图书编号、单价、作者、存在状态、借书人姓名、性别、学号等信息。然后就是需要实现的功能,这里可以实现新进图书基本信息的输入、图书基本信息的查询、对撤消图书信息的删除、为借书人办理注册、办理借书手续和办理还书手续等功能。
相关问题
使用C语言进行一个图书管理系统设计 图书管理信息包括:图书名称、图书编号、单价、作者、存在状态、借书人姓名、性别、学号等 功能描述: 1、新进图书基本信息的输入。 2、图书基本信息的查询。 3、对撤消图书信息的删除。 4、为借书人办理注册。 5、办理借书手续。 6、办理还书手续 要求:使用文件方式存储数据。
这是一个图书管理系统的设计,使用C语言编写。该系统包括以下图书管理信息:图书名称、图书编号、单价、作者、存储状态、借书人姓名、性别和学号。系统具有以下功能描述:
1. 输入新图书的基本信息。
2. 查询图书的基本信息。
3. 删除撤消图书信息。
4. 注册借书人。
5. 完成借书手续。
6. 完成还书手续。
该系统要求使用文件存储数据。
用C语言写一个图书管理系统,要包含(添加图书信息、借书还书、添加读者信息、)
好的,下面是一个用C语言编写的简单图书管理系统的示例,其中包含添加图书信息、借书还书、添加读者信息等功能。
```c
#include <stdio.h>
#include <string.h>
#define MAX_BOOKS 100 // 最大图书数量
#define MAX_READERS 100 // 最大读者数量
struct Book {
int id; // 图书编号
char title[50]; // 图书名称
char author[50]; // 图书作者
int status; // 图书状态:0代表可借,1代表已借出
};
struct Reader {
int id; // 读者编号
char name[50]; // 读者姓名
int book_id; // 读者借的图书编号,如果没有借图书则为0
};
struct Book books[MAX_BOOKS]; // 图书数组
struct Reader readers[MAX_READERS]; // 读者数组
int num_books = 0; // 当前图书数量
int num_readers = 0; // 当前读者数量
// 添加图书信息
void add_book() {
if (num_books == MAX_BOOKS) {
printf("图书数量已达到上限,无法添加新的图书!\n");
return;
}
struct Book book;
printf("请输入图书编号:");
scanf("%d", &book.id);
printf("请输入图书名称:");
scanf("%s", book.title);
printf("请输入图书作者:");
scanf("%s", book.author);
book.status = 0; // 初始状态为可借
books[num_books] = book;
num_books++;
printf("添加成功!\n");
}
// 借书
void borrow_book() {
int reader_id, book_id;
printf("请输入读者编号:");
scanf("%d", &reader_id);
printf("请输入图书编号:");
scanf("%d", &book_id);
// 查找读者和图书
struct Reader *reader = NULL;
for (int i = 0; i < num_readers; i++) {
if (readers[i].id == reader_id) {
reader = &readers[i];
break;
}
}
if (reader == NULL) {
printf("未找到该读者!\n");
return;
}
struct Book *book = NULL;
for (int i = 0; i < num_books; i++) {
if (books[i].id == book_id) {
book = &books[i];
break;
}
}
if (book == NULL) {
printf("未找到该图书!\n");
return;
}
if (book->status == 1) {
printf("该图书已被借出!\n");
return;
}
book->status = 1; // 设置为已借出状态
reader->book_id = book_id; // 记录读者借的图书编号
printf("借书成功!\n");
}
// 还书
void return_book() {
int reader_id, book_id;
printf("请输入读者编号:");
scanf("%d", &reader_id);
printf("请输入图书编号:");
scanf("%d", &book
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)