📄 car_dealer.cpp~
字号:
/*
Name: CHAI, Wennan
StudentID: 780621
Program: car_dealer.cpp
Description:
*/
#include <iostream>
#include <string>
#include "TCarMarket.h"
using namespace std;
int InputChoice()
{
int choice;
do
{
cout<<"Please select one from the value (1-4) : ";
cin>>choice;
}while( (choice<1) || (choice>4));
return choice;
}
void ShowMenu()
{
cout<<"=========================="<<endl;
cout<<" MENU "<<endl;
cout<<"1 -- Add a car "<<endl;
cout<<"2 -- Sell a car "<<endl;
cout<<"3 -- List all cars "<<endl;
cout<<"4 -- Exit "<<endl;
cout<<" "<<endl;
cout<<"=========================="<<endl;
}
int main()
{
int c;
TCarMarket Newshop;
do
{
ShowMenu();
c = InputChoice();
if(c==1){Newshop.AddCar();}
if(c==2){Newshop.ListCar(); Newshop.SellCar();}
if(c==3){Newshop.ListCar();}
}while (c!=4);
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -