parksysteml.cpp

来自「Car Parking System project for software 」· C++ 代码 · 共 63 行

CPP
63
字号
// ParkSystemL.cpp : Defines the entry point for the console application.
//
#include <iostream.h>
#include <string.h>
#include "classheaders.h"
void main()

{	
	CPlace cpark;
	LPlace lpark;
	Place park;
	int choice=0;
	Car* c1;
	Lorry* l1;
	
	do
	{
		cout<<"				1. Add Car to Park"<<endl;
		cout<<"				2. Add Lorry to Park"<<endl;
		cout<<"				3. Remove Car From Park"<<endl;
		cout<<"				4. Remove Lorry From Park"<<endl;
		cout<<"				5. Show Park"<<endl;
		cout<<"				6. Show Car Park"<<endl;
		cout<<"				7. Show Lorry Park"<<endl;
		cout<<"				8. QUIT"<<endl;
		cout<<"				9. Total Entry Today"<<endl;
		cout<<"Choice = ";
		cin>>choice;
		cout<<endl;
		cout<<endl;
		switch(choice)
		{
		case 1:
			c1=new Car;
			cpark.CarIn(c1);
			break;
		case 2:
			l1=new Lorry;
			lpark.LorryIn(l1);
			break;
		case 3:
			c1=cpark.CarOut();
			delete c1;
			break;
		case 4:
			l1=lpark.LorryOut();
			delete l1;
			break;
		case 5:
			cout<<"Cars in Car Park: ";
			cout<<cpark.ShowCarPark()<<endl;
			cout<<"Lorries in Lorry Park: ";
			cout<<lpark.ShowLorryPark()<<endl;
			break;
		case 6:
			cout<<Car::getCarCount()<<endl;
			break;
			
		case 7:
			cout<<Lorry::getLorryCount()<<endl;
			break;
		case 8:
			cout<<"===Thank you for using CewSoft

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?