資源簡介
c++做的庫存管理程序,是一c++課程的大作業,里面有作業要求和對應是實現,供大家學習使用

代碼片段和文件信息
#include?
#include?
#include?
#include?
using?namespace?std;
const?int?WIDTH?=?80;
const?int?SECTION_ONE_MINIMUM?=?10;
const?int?SECTION_TWO_MINIMUM?=?100;
const?int?SECTION_THREE_MINIMUM?=?500;
int?min_quantity(char?section)
{
switch?(section)
{
case?‘A‘:case?‘B‘:case?‘C‘:case?‘D‘:case?‘E‘:case?‘F‘:
return?SECTION_ONE_MINIMUM;
case?‘G‘:case?‘H‘:case?‘I‘:case?‘J‘:case?‘K‘:case?‘L‘:
return?SECTION_TWO_MINIMUM;
default:
return?SECTION_THREE_MINIMUM;
}
}
int?main()
{
cout?< cout?< cout?< cout?< /*Part?1*/
cout?<“This?part?of?the?program?will?determine?the?quantity\n?of?each?item?in?the?warehouse?to?be?ordered“< cout?<“Select?the?inventory?file?you?want?to?process:“< cout?<“1.?Ex5-1.txt“< cout?<“2.?Ex5-2.txt“< cout?< while?(1)?{
cout?<“Enter?a??number?of?the?input?file:“;
int?i;
string?filename;
cin?>>?i;
ofstream?fout(“Ex5Out.txt“);
switch?(i)
{
case?1:
filename?=?“Ex5-1.txt“;break;
case?2:
filename?=?“Ex5-2.txt“;?break;
default:
cout?<“\t\tyour?entry?is?not?valid.Try?again.“?< continue;
}
cout?< cout?<“The?file?“?< cout?<“The?file?Ex5Out.txt?will?contain?the?results?of?the?analysis.“?< fout?< fout?< fout?< fout?< fout?<“This?file?contains?the?quantity?of?each?item?in?the?warehouse?to?be?ordered.“?< fout?<“The?inventory?file?used: “?< fout?< fout?< < < fout?< fout?< ifstream?fin(filename);
while?(fin)
{
string?item_name;
int?floor;
char?section;
int?quantity;
getline(fin?item_name);
fin?>>?floor;
fin?>>?section;
fin?>>?quantity;
int?minq?=?min_quantity(section);
fout?< <
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????152??2018-11-09?11:00??EX5-1.txt
?????文件?????????152??2018-11-09?11:00??EX5-2.txt
?????文件????????1008??2018-11-09?16:02??Ex5Out.txt
?????文件????????4008??2018-11-09?16:02??main.cpp
?????文件???????29684??2018-11-09?16:02??screen.png
?????文件??????371566??2018-11-09?06:35??CST113Ex5_DL1.pdf
- 上一篇:操作系統仿真之內存替換算法
- 下一篇:c++實現找出數組最大值函數
評論
共有 條評論