|
|
@ -122,6 +122,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### C6: 打印库存列表
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
选择菜单命令 `3`,打印
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
请选择:3
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
| NUMBER | NAME | ON HAND |
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
| 101 | 小米 | 80 |
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### C7: 修改库存记录
|
|
|
|
#### C7: 修改库存记录
|
|
|
|
|
|
|
|
|
|
|
|
选择菜单命令 `6`,根据提示输入学号,若学号存在,则继续输入学号、姓名、成绩,并修改库存记录;否则,提示学号不存在并结束。
|
|
|
|
选择菜单命令 `6`,根据提示输入学号,若学号存在,则继续输入学号、姓名、成绩,并修改库存记录;否则,提示学号不存在并结束。
|
|
|
@ -211,4 +225,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### C10: 从文件中读取库存记录
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
选择菜单命令 `1`,提示输入文件名,若文件存在,则打开文件读取 CSV 格式保存的所有库存记录;否则,若文件不存在,则给出错误信息并结束。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
假设文件 `a.csv` 中,以 CSV (Comma-Separated Values)格式保存了如下记录:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
103,小圆,80
|
|
|
|
|
|
|
|
104,小光,100
|
|
|
|
|
|
|
|
101,小米,80
|
|
|
|
|
|
|
|
102,小明,70
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
则读取记录的过程如下:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
请选择:1
|
|
|
|
|
|
|
|
读取数据
|
|
|
|
|
|
|
|
请输入文件名:a.csv
|
|
|
|
|
|
|
|
读取 4 记录
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 读取 | 2 保存 | 3 打印 | 4 查询 | 5 添加
|
|
|
|
|
|
|
|
6 修改 | 7 删除 | 8 排序 | 9 图表 | 0 退出
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
请选择:3
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
| NUMBER | NAME | ON HAND |
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
| 103 | 小圆 | 80 |
|
|
|
|
|
|
|
|
| 104 | 小光 | 100 |
|
|
|
|
|
|
|
|
| 101 | 小米 | 80 |
|
|
|
|
|
|
|
|
| 102 | 小明 | 70 |
|
|
|
|
|
|
|
|
-------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 读取 | 2 保存 | 3 打印 | 4 查询 | 5 添加
|
|
|
|
|
|
|
|
6 修改 | 7 删除 | 8 排序 | 9 图表 | 0 退出
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
请选择:1
|
|
|
|
|
|
|
|
读取数据
|
|
|
|
|
|
|
|
请输入文件名:a
|
|
|
|
|
|
|
|
a: No such file or directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|