经过数据结构实训,我第一次一个人写出了1000多行的代码,对自己也是一个挑战吧

#include <iostream>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <cstring>
#include <windows.h>#include <stack>
#include <queue>
using namespace std;//定义一个主菜单操作员显示类,供操作员登陆管理
class MainMenu
{
public:void ShowMain();
} MainMenu1;
void MainMenu::ShowMain()
{cout<<"\t┏═══════════════════════════┓"<<endl;cout<<"\t┃        ┃★★欢迎进入汽车销售管理系统★★┃          ┃"<<endl;cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃                 ★1 操作员登陆                       ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}
//定义一个操作员管理类,以便系统安全运行
class OperatorMain
{
public:void OperatorShow();
} OperatorMain1;
void OperatorMain::OperatorShow()
{cout<<"\t┏═══════════════════════════┓"<<endl;cout<<"\t┃        ┃★★欢迎进入汽车销售管理系统★★┃          ┃"<<endl;cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★1 用户管理                                         ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★2 车辆采购管理                                     ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★3 车辆销售管理                                     ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★4 车辆库存管理                                     ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ 请按数字键选择(数字0退出)                              ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}
//定义一个操作员信息的验证类,声明它的私有成员和公用成员,以便系统安全运行
class Operator
{
private:string OperatorName;string OperatorMima;string Name;string Mima;
public:Operator()//定义构造函数,数据的初始化{OperatorName="admin";OperatorMima="123456";}void Cin();void Cout();
} Operator1;
void Operator::Cin()
{cout<<"\t\t请正确输入操作员的姓名:"<<endl;cin>>Name;cout<<"\t\t请正确输入操作员的密码:"<<endl;cin>>Mima;
}
void Operator::Cout()
{if(Name=="admin" && Mima=="123456"){cout<<"\t登陆成功!"<<endl;cout<<"\t请执行以下操作:"<<endl;}else{cout<<"\t输入错误"<<endl;cout<<"\t系统处于崩溃状态,请重新进行操作!"<<endl;Sleep(100000000);system("cls");}
}
//定义用户信息类
class User
{
//使用链表的第一步:创建类 保存数据long
public://数据域,用来记录数据string UserName;//用户姓名char UserSex;//用户性别int UserAge;//用户年龄long UserNumber;//用户客户号string UserAddress;//用户地址string UserLink;//用户联系方式//指着域,用来记录它下一个节点的地址//访问这个变量能找到它的下一个节点User *next;void UserAdd(User *head1,User *move1,User *temp1);void UserDel(User *head1,User *move1,User *temp1);void UserChange(User *head1,User *move1,User *temp1);void UserFind(User *head1,User *move1,User *temp1);void UserInsert(User *head1,User *move1,User *temp1);
} User1;
//使用链表的第二步:创建三个指针 备用
//User *head1,*move1,*temp1;
//使用链表的第三步:创建节点
User *head1=new User;
//用户信息的增删改查
void User::UserAdd(User *head1,User *move1,User *temp1)
{cout<<"请输入有几个用户:"<<endl;int n =0;cin>>n;for(int i=0; i<n; i++){//给节点赋值cout<<"请输入第"<<i+1<<"个用户的姓名:"<<endl;;cin>>move1->UserName;//给节点赋值cout<<"请输入第"<<i+1<<"个用户的性别:"<<endl;;cin>>move1->UserSex;//给节点赋值cout<<"请输入第"<<i+1<<"个用户的年龄:"<<endl;;cin>>move1->UserAge;//给节点赋值cout<<"请输入第"<<i+1<<"个用户的客户号:"<<endl;;cin>>move1->UserNumber;//给节点赋值cout<<"请输入第"<<i+1<<"个用户的地址:"<<endl;;cin>>move1->UserAddress;//给节点赋值cout<<"请输入第"<<i+1<<"个用户的联系方式:"<<endl;;cin>>move1->UserLink;//--------//这里就是链表连接的关键代码//先移动temp1指针temp1=move1;User *move1=new User;temp1->next=move1;}//这里注意链表规定 最后节点的next一定要指向NULLtemp1=move1;temp1->next=NULL;//个人习惯move1=head1;
}
void User::UserDel(User *head1,User *move1,User *temp1)
{cout<<"请输入要删除的客户号:"<<endl;long Number=0;cin>>Number;if(head1->UserNumber==Number){head1=head1->next;free(head1);cout<<"成功删除用户!"<<endl;}else{while(move1->next!=NULL){if(move1->UserNumber==Number){temp1->next=move1->next;free(move1);cout<<"成功删除用户!"<<endl;break;}temp1=move1;move1=move1->next;}}move1=head1;
}
void User::UserChange(User *head1,User *move1,User *temp1)
{cout<<"请输入要修改的用户的客户号:"<<endl;long Number=0;cin>>Number;while(move1->next!=NULL){if(move1->UserNumber==Number){//给节点重新赋值cout<<"请输入用户的客户号:"<<endl;cin>>move1->UserNumber;//给节点重新赋值cout<<"请输入用户的姓名:"<<endl;cin>>move1->UserName;//给节点重新赋值cout<<"请输入用户的性别:"<<endl;cin>>move1->UserSex;//给节点重新赋值cout<<"请输入用户的年龄:"<<endl;cin>>move1->UserAge;//给节点重新赋值cout<<"请输入用户的地址:"<<endl;cin>>move1->UserAddress;//给节点重新赋值cout<<"请输入用户的联系方式:"<<endl;cin>>move1->UserLink;}move1=move1->next;}move1=head1;
}
void User::UserFind(User *head1,User *move1,User *temp1)
{cout<<"请输入要查找的用户的客户号:"<<endl;long Number=0;cin>>Number;while(move1->next!=NULL){if(move1->UserNumber==Number){cout<<"成功查找到用户!"<<endl;}move1=move1->next;}move1=head1;
}
void User::UserInsert(User *head1,User *move1,User *temp1)
{cout<<"请输入要在哪个用户的客户号后面插入:"<<endl;long Number=0;cin>>Number;while(move1->next!=NULL){if(move1->UserNumber==Number){User *temp1 = new User;cout<<"请输入用户的客户号:"<<endl;cin>>move1->UserNumber;//给节点赋值cout<<"请输入用户的姓名:"<<endl;cin>>move1->UserName;//给节点赋值cout<<"请输入用户的性别:"<<endl;cin>>move1->UserSex;//给节点重新赋值cout<<"请输入用户的年龄:"<<endl;cin>>move1->UserAge;//给节点重新赋值cout<<"请输入用户的地址:"<<endl;cin>>move1->UserAddress;//给节点重新赋值cout<<"请输入用户的联系方式:"<<endl;cin>>move1->UserLink;//----temp1->next=move1->next;move1->next=temp1;}move1=move1->next;}temp1=move1;temp1->next=NULL;move1=head1;
}
class UserInfor
{
public:void ShowInfor();
} UserInfor1;
void UserInfor::ShowInfor()
{cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃ ★1 用户信息的添加                                   ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★2 用户信息的删除                                   ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★3 用户信息的修改                                   ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★4 用户信息的查找                                   ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★5 用户信息的插入                                   ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}
//定义一个车辆采购类,以便操作员对车辆进行添加
class CarPurchase
{
//使用链表的第一步:创建类 保存数据
public:
//数据域,用来记录数据long Purchase_Number;//采购订单号string Purchase_Date;//采购日期long Firm_Num;//厂商编号string Firm_Name;//厂商名称string Link_Man;//联系人string Link_Num;//联系电话string Zip_Code;//邮政编码string Mail_Address;//通信地址string Car_Code;//车型代码string Car_Type;//车辆类型string Brand_Type;//厂牌型号string Produce_Area;//产地string Purchase_price;//采购单价string Sale_Man;//业务员string Produce_Man;//制单员//指着域,用来记录它下一个节点的地址//访问这个变量能找到它的下一个节点CarPurchase *next;void CarPurchaseAdd(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2);void CarPurchaseDel(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2);void CarPurchaseChange(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2);void CarPurchaseFind(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2);void CarPurchaseInsert(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2);
} CarPurchase1;
//使用链表的第二步:创建三个指针 备用
//User *head1,*move1,*temp1;
//使用链表的第三步:创建节点
CarPurchase *head2=new CarPurchase;
void CarPurchase::CarPurchaseAdd(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2)
{cout<<"请输入汽车的数量:"<<endl;int n =0;cin>>n;for(int i=0; i<n; i++){//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的采购订单号:"<<endl;;cin>>move2->Purchase_Number;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的采购日期:"<<endl;;cin>>move2->Purchase_Date;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的厂商编号:"<<endl;;cin>>move2->Firm_Num;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的厂商名称:"<<endl;;cin>>move2->Firm_Name;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的联系人:"<<endl;;cin>>move2->Link_Man;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的联系电话:"<<endl;;cin>>move2->Link_Num;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的邮政编码:"<<endl;;cin>>move2->Zip_Code;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的通信地址:"<<endl;;cin>>move2->Mail_Address;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的车型代码:"<<endl;;cin>>move2->Car_Code;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的车辆类型:"<<endl;;cin>>move2->Car_Type;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的厂牌型号:"<<endl;;cin>>move2->Brand_Type;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的产地:"<<endl;;cin>>move2->Produce_Area;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的采购单价:"<<endl;;cin>>move2->Purchase_price;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的业务员:"<<endl;;cin>>move2->Sale_Man;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的制单员:"<<endl;;cin>>move2->Produce_Man;//--------//这里就是链表连接的关键代码//先移动temp1指针temp2=move2;CarPurchase *move2=new CarPurchase;temp2->next=move2;}//这里注意链表规定 最后节点的next一定要指向NULLtemp2=move2;temp2->next=NULL;//个人习惯move2=head2;
}
void CarPurchase::CarPurchaseDel(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2)
{cout<<"请输入要删除的车辆的采购订单号:"<<endl;long Number=0;cin>>Number;if(head2->Purchase_Number==Number){head2=head2->next;free(head2);cout<<"成功删除该车辆采购的所有相关信息!"<<endl;}else{while(move2->next!=NULL){if(move2->Purchase_Number==Number){temp2->next=move2->next;free(move2);cout<<"成功删除该车辆采购的所有相关信息!"<<endl;break;}temp2=move2;move2=move2->next;}}move2=head2;
}
void CarPurchase::CarPurchaseChange(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2)
{cout<<"请输入要修改的厂商编号:"<<endl;long Number=0;cin>>Number;while(move2->next!=NULL){if(move2->Purchase_Number==Number){//给节点赋值cout<<"请输入汽车的采购订单号:"<<endl;;cin>>move2->Purchase_Number;//给节点赋值cout<<"请输入汽车的采购日期:"<<endl;;cin>>move2->Purchase_Date;//给节点赋值cout<<"请输入汽车的厂商编号:"<<endl;;cin>>move2->Firm_Num;//给节点赋值cout<<"请输入汽车的厂商名称:"<<endl;;cin>>move2->Firm_Name;//给节点赋值cout<<"请输入汽车的联系人:"<<endl;;cin>>move2->Link_Man;//给节点赋值cout<<"请输入汽车的联系电话:"<<endl;;cin>>move2->Link_Num;//给节点赋值cout<<"请输入汽车的邮政编码:"<<endl;;cin>>move2->Zip_Code;//给节点赋值cout<<"请输入汽车的通信地址:"<<endl;;cin>>move2->Mail_Address;//给节点赋值cout<<"请输入汽车的车型代码:"<<endl;;cin>>move2->Car_Code;//给节点赋值cout<<"请输入汽车的车辆类型:"<<endl;;cin>>move2->Car_Type;//给节点赋值cout<<"请输入汽车的厂牌型号:"<<endl;;cin>>move2->Brand_Type;//给节点赋值cout<<"请输入汽车的产地:"<<endl;;cin>>move2->Produce_Area;//给节点赋值cout<<"请输入汽车的采购单价:"<<endl;;cin>>move2->Purchase_price;//给节点赋值cout<<"请输入汽车的业务员:"<<endl;;cin>>move2->Sale_Man;//给节点赋值cout<<"请输入汽车的制单员:"<<endl;;cin>>move2->Produce_Man;}move2=move2->next;}move2=head2;
}
void CarPurchase::CarPurchaseFind(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2)
{cout<<"请输入要查找的车辆的采购订单号:"<<endl;long Number=0;cin>>Number;while(move2->next!=NULL){if(move2->Purchase_Number==Number){cout<<"成功查找到车辆的采购信息!"<<endl;}move2=move2->next;}move2=head2;
}
void CarPurchase::CarPurchaseInsert(CarPurchase *head2,CarPurchase *move2,CarPurchase *temp2)
{cout<<"请输入要在哪个车辆的采购订单号后面插入:"<<endl;long Number=0;cin>>Number;while(move2->next!=NULL){if(move2->Purchase_Number==Number){CarPurchase *temp2 = new CarPurchase;//给节点赋值cout<<"请输入汽车的采购订单号:"<<endl;;cin>>move2->Purchase_Number;//给节点赋值cout<<"请输入汽车的采购日期:"<<endl;;cin>>move2->Purchase_Date;//给节点赋值cout<<"请输入汽车的厂商编号:"<<endl;;cin>>move2->Firm_Num;//给节点赋值cout<<"请输入汽车的厂商名称:"<<endl;;cin>>move2->Firm_Name;//给节点赋值cout<<"请输入汽车的联系人:"<<endl;;cin>>move2->Link_Man;//给节点赋值cout<<"请输入汽车的联系电话:"<<endl;;cin>>move2->Link_Num;//给节点赋值cout<<"请输入汽车的邮政编码:"<<endl;;cin>>move2->Zip_Code;//给节点赋值cout<<"请输入汽车的通信地址:"<<endl;;cin>>move2->Mail_Address;//给节点赋值cout<<"请输入汽车的车型代码:"<<endl;;cin>>move2->Car_Code;//给节点赋值cout<<"请输入汽车的车辆类型:"<<endl;;cin>>move2->Car_Type;//给节点赋值cout<<"请输入汽车的厂牌型号:"<<endl;;cin>>move2->Brand_Type;//给节点赋值cout<<"请输入汽车的产地:"<<endl;;cin>>move2->Produce_Area;//给节点赋值cout<<"请输入汽车的采购单价:"<<endl;;cin>>move2->Purchase_price;//给节点赋值cout<<"请输入汽车的业务员:"<<endl;;cin>>move2->Sale_Man;//给节点赋值cout<<"请输入汽车的制单员:"<<endl;;cin>>move2->Produce_Man;//----temp2->next=move2->next;move2->next=temp2;}move2=move2->next;}temp2=move2;temp2->next=NULL;move2=head2;
}class CarPurchaseInfor
{
public:void CarPurchaseInforMain();
} CarPurchaseInfor1;
void CarPurchaseInfor::CarPurchaseInforMain()
{cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃ ★1 车辆采购信息的添加                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★2 车辆采购信息的删除                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★3 车辆采购信息的修改                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★4 车辆采购信息的查找                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★5 车辆采购信息的插入                               ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}
//定义一个车辆的销售类,以便操作员对车辆销售
class CarSell
{
public://1数据域long Sell_Num;//销售单号long Client_Num;//客户编号string Client_Name;//客户名称string Car_Code;//车型代码string Car_Type;//车辆类型string Produce_Type;//厂牌型号string Produce_Area;//产地//2指针域CarSell *next;void CarSellAdd(CarSell *head3,CarSell *move3,CarSell *temp3);void CarSellDel(CarSell *head3,CarSell *move3,CarSell *temp3);void CarSellChange(CarSell *head3,CarSell *move3,CarSell *temp3);void CarSellFind(CarSell *head3,CarSell *move3,CarSell *temp3);void CarSellInsert(CarSell *head3,CarSell *move3,CarSell *temp3);
} CarSell1;
CarSell *head=new CarSell;
void CarSell::CarSellAdd(CarSell *head3,CarSell *move3,CarSell *temp3)
{cout<<"请输入汽车的数量:"<<endl;int n =0;cin>>n;for(int i=0; i<n; i++){//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的销售单号:"<<endl;;cin>>move3->Sell_Num;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的客户编号:"<<endl;;cin>>move3->Client_Num;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的客户名称:"<<endl;;cin>>move3->Client_Name;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的车型代码:"<<endl;;cin>>move3->Car_Code;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的车辆类型:"<<endl;;cin>>move3->Car_Type;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的厂牌型号:"<<endl;;cin>>move3->Produce_Type;//给节点赋值cout<<"请输入第"<<i+1<<"辆汽车的产地:"<<endl;;cin>>move3->Produce_Area;//--------//这里就是链表连接的关键代码//先移动temp1指针temp3=move3;CarSell *move3=new CarSell;temp3->next=move3;}//这里注意链表规定 最后节点的next一定要指向NULLtemp3=move3;temp3->next=NULL;//个人习惯move3=head3;
}
void CarSell::CarSellDel(CarSell *head3,CarSell *move3,CarSell *temp3)
{cout<<"请输入要删除的车辆的销售单号:"<<endl;long Number=0;cin>>Number;if(head3->Sell_Num==Number){head3=head3->next;free(head3);cout<<"成功删除该车辆销售的所有相关信息!"<<endl;}else{while(move3->next!=NULL){if(move3->Sell_Num==Number){temp3->next=move3->next;free(move3);cout<<"成功删除该车辆销售的所有相关信息!"<<endl;break;}temp3=move3;move3=move3->next;}}move3=head3;
}
void CarSell::CarSellChange(CarSell *head3,CarSell *move3,CarSell *temp3)
{cout<<"请输入要修改的销售单号:"<<endl;long Number=0;cin>>Number;while(move3->next!=NULL){if(move3->Sell_Num==Number){//给节点赋值cout<<"请输入汽车的销售单号:"<<endl;;cin>>move3->Sell_Num;//给节点赋值cout<<"请输入汽车的客户编号:"<<endl;;cin>>move3->Client_Num;//给节点赋值cout<<"请输入汽车的客户名称:"<<endl;;cin>>move3->Client_Name;//给节点赋值cout<<"请输入汽车的车型代码:"<<endl;;cin>>move3->Car_Code;//给节点赋值cout<<"请输入汽车的车辆类型:"<<endl;;cin>>move3->Car_Type;//给节点赋值cout<<"请输入汽车的厂牌型号:"<<endl;;cin>>move3->Produce_Type;//给节点赋值cout<<"请输入汽车的产地:"<<endl;;cin>>move3->Produce_Area;//--------}move3=move3->next;}move3=head3;
}
void CarSell::CarSellFind(CarSell *head3,CarSell *move3,CarSell *temp3)
{cout<<"请输入要查找的车辆的销售单号:"<<endl;long Number=0;cin>>Number;while(move3->next!=NULL){if(move3->Sell_Num==Number){cout<<"成功查找到车辆的销售信息!"<<endl;}move3=move3->next;}move3=head3;
}
void CarSell::CarSellInsert(CarSell *head3,CarSell *move3,CarSell *temp3)
{cout<<"请输入要在哪个车辆的销售单号后面插入:"<<endl;long Number=0;cin>>Number;while(move3->next!=NULL){if(move3->Sell_Num==Number){CarSell *temp3 = new CarSell;//给节点赋值cout<<"请输入汽车的销售单号:"<<endl;;cin>>move3->Sell_Num;//给节点赋值cout<<"请输入汽车的客户编号:"<<endl;;cin>>move3->Client_Num;//给节点赋值cout<<"请输入汽车的客户名称:"<<endl;;cin>>move3->Client_Name;//给节点赋值cout<<"请输入汽车的车型代码:"<<endl;;cin>>move3->Car_Code;//给节点赋值cout<<"请输入汽车的车辆类型:"<<endl;;cin>>move3->Car_Type;//给节点赋值cout<<"请输入汽车的厂牌型号:"<<endl;;cin>>move3->Produce_Type;//给节点赋值cout<<"请输入汽车的产地:"<<endl;;cin>>move3->Produce_Area;//--------temp3->next=move3->next;move3->next=temp3;}move3=move3->next;}temp3=move3;temp3->next=NULL;move3=head3;
}
class CarSellInfor
{
public:void CarSellInforMain();
} CarSellInfor1;
void CarSellInfor::CarSellInforMain()
{cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃ ★1 车辆销售信息的添加                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★2 车辆销售信息的删除                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★3 车辆销售信息的修改                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★4 车辆销售信息的查找                               ┃"<<endl;cout<<"\t┃                                                      ┃"<<endl;cout<<"\t┃ ★5 车辆销售信息的插入                               ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}
class CarStore
{
public://1数据域long InStore_Num;//入库单号long Firm_Num;//厂商编号string Firm_Name;//厂商名称string Car_Code;//车型代码string Car_Type;//车辆类型string Brand_Type;//厂牌型号string Produce_Area;//产地//2指针域CarStore *next;void Infor();void Qsort(int l,int r);int paixu(int l,int r);void BarInserch();void LatterDo();
} CarStore1;
int InStore_N[1000];
int CarStore::paixu(int l,int r)
{int i=l;int j=r;int x=InStore_N[l];while(i<j)// 结束递归{while(i<j && InStore_N[j]>=x) j--;// 从右向左找第一个小于x的数InStore_N[i]=InStore_N[j];while(i<j && InStore_N[i]<=x) i++;// 从左向右找第一个大于x的数InStore_N[j]=InStore_N[i];}InStore_N[i]=x;return i;
}
void CarStore::Qsort(int l,int r)
{if(l>=r) return;int x=paixu(l,r);Qsort(l,x-1);Qsort(x+1,r);
}
void CarStore::Infor()
{cout<<"请输入入库单号的数量:"<<endl;int n;cin>>n;for(int i=0; i<n; i++){cout<<"请分别依次输入入库单号:"<<endl;cin>>InStore_N[i];}Qsort(0,n-1);for(int i=0; i<n; i++){if(i==0)cout<<InStore_N[i];elsecout<<" "<<InStore_N[i];}cout<<"车辆的入库单号从小到大排序成功!"<<endl;
}
void CarStore::BarInserch()
{int n;int flag;//设置一个标记变量int key,mid,low,high;cout<<"请输入入库单号的数量:"<<endl;cin>>n;flag=-1;//特殊标记low=1;high=n;for(int i=1; i<=n; i++){cout<<"请依次输入n个递增的入库单号的序列:"<<endl;cin>>InStore_N[i];}cout<<"请输入你要查询的入库单号:"<<endl;cin>>key;while(low<=high){mid=(low+high)/2;if(key==InStore_N[mid]){flag=mid;break;}else if(key<InStore_N[mid]){high=mid-1;}else if(key>InStore_N[mid]){low=mid+1;}}if(flag!=-1){cout<<"存在要查找的入库单号的信息,查找成功!"<<endl;}else{cout<<"不存在要查找的入库单号的信息,查找失败!"<<endl;}
}
void CarStore::LatterDo()
{stack<int>q;int T;string str;cout<<"请输入入库单的数量:"<<endl;cin>>T;for(int i=0; i<T; i++){stack<int> q;for(int i=0; i<T; i++){cout<<"输入一个字符串来表示你要进行的操作:"<<endl;cout<<"1:push代表你要在入库单后面再添加。"<<endl;cout<<"2:pop代表你要删除最后面的入库单号。"<<endl;cout<<"3:top代表你要找出最后面的入库单号。"<<endl;cout<<"请输入3个关键词中的其中一个:"<<endl;cin>>str;          //操作判断if(str=="push"){int n;cout<<"请输入你要添加的入库单号:"<<endl;cin>>n;q.push(n);//进栈continue;}else if(str=="top"){if(q.empty()){cout<<"empty"<<endl;   //清空判断cout<<"这是一个空的入库单号!"<<endl;}else{cout<<q.top()<<endl;cout<<"成功查找到最后一个入库单号!"<<endl;}continue;}else if(str=="pop"){if(q.empty()){cout<<"error"<<endl;cout<<"这是一个空的入库单号!"<<endl;}else{q.pop();      //删除第一个元素cout<<"成功删除最后一个入库单号!"<<endl;}continue;}}cout<<endl;//注意要求,多空一行}
}
class CarStoreInfor
{
public:void CarStoreInforMain();
} CarStoreInfor1;
void CarStoreInfor::CarStoreInforMain()
{cout<<"\t┠═══════════════════════════┨"<<endl;cout<<"\t┃ ★1 按照入库单号从小到大的排序                   ┃"<<endl;cout<<"\t┃                                                  ┃"<<endl;cout<<"\t┃ ★2 查找入库单号                                 ┃"<<endl;cout<<"\t┃                                                  ┃"<<endl;cout<<"\t┃ ★3 在入库单号后面添加一个新入库单号             ┃"<<endl;cout<<"\t┃     删除最后面的入库单号                         ┃"<<endl;cout<<"\t┃     找出最后面的入库单号                         ┃"<<endl;cout<<"\t┃                                                  ┃"<<endl;cout<<"\t┗═══════════════════════════┛"<<endl;
}//主函数
int main()
{int choose=0;MainMenu1.ShowMain();cout<<"请选择你的操作:"<<endl;system("color 0c");//调用系统的颜色函数while(1){cin>>choose;if(choose){if(choose==1){Operator1.Cin();Operator1.Cout();Sleep(1000);system("cls");OperatorMain1.OperatorShow();cout<<"请选择管理的对象:"<<endl;int choose0;cin>>choose0;if(choose0==1){system("cls");UserInfor1.ShowInfor();User *head1,*move1,*temp1;head1=move1=(User *)malloc(sizeof(User));int choose1=0;cout<<"请选择对用户信息的操作"<<endl;cin>>choose1;if(choose1==1){User1.UserAdd(head1,move1,temp1);Sleep(1000);}else if(choose1==2){User1.UserDel(head1,move1,temp1);Sleep(1000);}else if(choose1==3){User1.UserChange(head1,move1,temp1);Sleep(1000);}else if(choose1==4){User1.UserFind(head1,move1,temp1);Sleep(1000);}else if(choose1==5){User1.UserInsert(head1,move1,temp1);Sleep(1000);}}if(choose0==2){system("cls");CarPurchaseInfor1.CarPurchaseInforMain();CarPurchase *head2,*move2,*temp2;head2=move2=(CarPurchase *)malloc(sizeof(CarPurchase));int choose2=0;cout<<"请选择对车辆采购信息的操作"<<endl;cin>>choose2;if(choose2==1){CarPurchase1.CarPurchaseAdd(head2,move2,temp2);Sleep(1000);}else if(choose2==2){CarPurchase1.CarPurchaseDel(head2,move2,temp2);Sleep(1000);}else if(choose2==3){CarPurchase1.CarPurchaseChange(head2,move2,temp2);Sleep(1000);}else if(choose2==4){CarPurchase1.CarPurchaseFind(head2,move2,temp2);Sleep(1000);}else if(choose2==5){CarPurchase1.CarPurchaseInsert(head2,move2,temp2);Sleep(1000);}}if(choose0==3){system("cls");CarSellInfor1.CarSellInforMain();CarSell *head3,*move3,*temp3;head3=move3=(CarSell *)malloc(sizeof(CarSell));int choose3=0;cout<<"请选择对车辆销售信息的操作"<<endl;cin>>choose3;if(choose3==1){CarSell1.CarSellAdd(head3,move3,temp3);Sleep(1000);}else if(choose3==2){CarSell1.CarSellDel(head3,move3,temp3);Sleep(1000);}else if(choose3==3){CarSell1.CarSellChange(head3,move3,temp3);Sleep(1000);}else if(choose3==4){CarSell1.CarSellFind(head3,move3,temp3);Sleep(1000);}else if(choose3==5){CarSell1.CarSellInsert(head3,move3,temp3);Sleep(1000);}}if(choose0==4){system("cls");CarStoreInfor1.CarStoreInforMain();int choose4=0;cout<<"请选择你对入库信息的操作:"<<endl;cin>>choose4;if(choose4==1){CarStore1.Infor();Sleep(1000);}if(choose4==2){CarStore1.BarInserch();Sleep(1000);}if(choose4==3){CarStore1.LatterDo();Sleep(1000);}}if(choose0==0){system("cls");break;}}}}return 0;
}

汽车销售管理系统源代码相关推荐

  1. asp.net师电子化信息库的设计与实现(源代码+论文)ASP.NET汽车销售管理系统的设计与开发(源代码+论文)

    asp.net师电子化信息库的设计与实现(源代码+论文)ASP.NET汽车销售管理系统的设计与开发(源代码+论文) 随着人们生活水平的不断提高,人们对汽车的消费和需求也越来越旺盛.很多汽车销售公司的业 ...

  2. java计算机毕业设计前后端分离健身房管理系统源代码+数据库+系统+lw文档

    java计算机毕业设计前后端分离健身房管理系统源代码+数据库+系统+lw文档 java计算机毕业设计前后端分离健身房管理系统源代码+数据库+系统+lw文档 本源码技术栈: 项目架构:B/S架构 开发语 ...

  3. java计算机毕业设计临港新片区招商引资项目管理系统源代码+数据库+系统+lw文档

    java计算机毕业设计临港新片区招商引资项目管理系统源代码+数据库+系统+lw文档 java计算机毕业设计临港新片区招商引资项目管理系统源代码+数据库+系统+lw文档 本源码技术栈: 项目架构:B/S ...

  4. jsp汽车销售管理系统Myeclipse开发mysql数据库web结构java编程计算机网页项目

    一.源码特点   jsp汽车销售管理系统 是一套完善的web设计系统,对理解JSP java编程开发语言有帮助,系统具有完整的源代码和数据库,系统主要采用B/S模式开发.开发环境为 TOMCAT7.0 ...

  5. java计算机毕业设计智能道路交通管理系统源代码+系统+数据库+lw文档

    java计算机毕业设计智能道路交通管理系统源代码+系统+数据库+lw文档 java计算机毕业设计智能道路交通管理系统源代码+系统+数据库+lw文档 本源码技术栈: 项目架构:B/S架构 开发语言:Ja ...

  6. java计算机毕业设计无极服装出租管理系统源代码+数据库+系统+lw文档

    java计算机毕业设计无极服装出租管理系统源代码+数据库+系统+lw文档 java计算机毕业设计无极服装出租管理系统源代码+数据库+系统+lw文档 本源码技术栈: 项目架构:B/S架构 开发语言:Ja ...

  7. Python课程设计:汽车销售管理系统

    汽车销售管理系统,可以做为掌握了一些基础知识后的一个练手小demo 小demo结构: 汽车销售管理系统:能够实现汽车销售管理与相关信息的保存和读取.实现所有库存汽车相关信息的录入,显示,销售,修改.设 ...

  8. JSP汽车销售管理系统myeclipse开发sql计算机程序web结构java编程网页源码

    一.源码特点      JSP  汽车销售管理系统 是一套完善的web设计系统,对理解JSP java编程开发语言有帮助,系统具有完整的源代码和数据库,系统主要采用B/S模式开发 JSP汽车销售管理系 ...

  9. c语言编程学生管理系统的代码,C语言学生管理系统源代码.doc

    C语言学生成绩管理系统源代码,保证能用-- #include "malloc.h" #include "stdio.h" #include "stdl ...

最新文章

  1. python-字典dict、去除重复set
  2. c++11の简单线程管理
  3. 自定义依赖注解无效_最详细的自定义Spring Boot Starter开发教程
  4. C语言 项目 CRM系统(客户信息管理系统)
  5. 遍历Page的Controls集合
  6. Javascript第六章闭包closure规则第三课
  7. Django 简易实现用户保持登录状态2月
  8. jquery uploadify 避免jquery.uploadify.min.js 文件多次引用导致只有最后一个才能上传
  9. wdcp安装多种php版本共存
  10. 李国庆与当当,一个中国网络书店的传奇
  11. UNews | 1.8亿!优维科技完成C轮融资!
  12. Python3.6+jieba+wordcloud 爬取豆瓣影评生成词云
  13. 原生js提供的视频画中画api
  14. Qt报错 converting to execution character set:illegal byte sequence
  15. 【洛谷】【模拟+栈】P4711 「化学」相对分子质量
  16. 操作系统之文件管理(二) ※
  17. matlab图形编辑,matlab绘制图形plot属性编辑
  18. 8则使用的Linux Shell命令
  19. 清理autodesk产品注册表_关于Autodesk软件的删除方法
  20. 浅谈windows NRTP

热门文章

  1. 初识Java----适合网络编程的语言
  2. 国庆快乐!上班中...
  3. CCC3.0学习笔记_快速交易
  4. python爬虫——全书网
  5. MES:为ERP和生产管控架一座桥(转)
  6. webpack如何设置html中img路径和css中背景图片路径区别开
  7. 【英语四六级-必背单词】高中英语单词(A - 1) MP3试听与下载
  8. P2P公司不良贷款的催收 不问过程只看结果
  9. 银河麒麟服务器系统搭建本地和局域网yum源
  10. Python每日一记181matplotlib之colormap(camp)