⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plane.cpp

📁 从课本上弄下来的例子
💻 CPP
字号:
#include"Plane.h"

Plane::Plane(int flt,int time,Plane_status status)
{
	flt_num=flt;
	clock_start=time;
	state=status;
	cout<<"Plane number "<<flt<<" ready to "<<((status==arriving)?"land.":"take off.")<<endl;
}

Plane::Plane()
{
	flt_num=-1;
	clock_start=-1;
	state=null;
}

void Plane::refuse()const
{
	cout<<"Plane number "<<flt_num
		<<((state==arriving)?" directed to another airport.":" told to try to takeoff again later.")<<endl;
}

void Plane::land(int time)const
{
	int wait=time-clock_start;
	cout<<time<<":Plane number "<<flt_num<<" landed after "
		<<wait<<" time unit"<<((wait==1)?"":"s")<<" in the takeoff queue."<<endl;
}

void Plane::fly(int time)const
{
	int wait=time-clock_start;
	cout<<time<<":Plane number "<<flt_num<<" took off after "
		<<wait<<" time unit"<<((wait==1)?"":"s")<<" in the takeoff queue."<<endl;
}

int Plane::started()const
{
	return clock_start;
}

⌨️ 快捷键说明

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