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

📄 custtype.cpp

📁 音像商店管理系统 1. 出租影碟 2. 返还影碟 3. 创建音像商店拥有的影碟清单 4. 显示某张特定影碟的具体信息 5. 显示商店所有影碟的清单 6. 检查某张影碟是否在商店中 7.
💻 CPP
字号:
#include <iostream.h>
#include "custType.h"

void custType::setCustInfo(newString acctno,newString fname,newString lname,
						   newString v1,newString v2,newString v3)
{   
	custAcctNo=acctno;
	firstName=fname;
	lastName=lname;
	video1=v1;
	video2=v2;
	video3=v3;
}

void custType::printcustInfo()
{
	cout<<"帐号:"<<custAcctNo<<endl;
	cout<<"姓名:"<<firstName<<" "<<lastName<<endl;
	cout<<"影碟: 1<"<<video1<<">; 2<"<<video2<<">; 3<"<<video3<<">"<<endl<<endl;
}

void custType::rentVideo(newString title)
{
	if(video1==" ")
		video1=title;
	else
	{
		if(video2==" ")
			video2=title;
		else
		{
			if(video3==" ")
				video3=title;
			else
				cout<<"你已经借满,不能再租碟!"<<endl;
		}
	}	
}

void custType::backVideo(newString title)
{
	if(video1==title)
		video1=" ";
	else 
	{
		if(video2==title)
			video2=" ";
		else
		{
			if(video3==title)
				video3=" ";
			else
				cout<<"对不起,该顾客并没有租此碟!"<<endl;
		}
	}
}

bool custType::checkcustAcctNo(newString id)
{
	return (custAcctNo==id);
}

custType::custType()
{
    firstName= " ";
	lastName= " ";
	custAcctNo= " ";
	video1= " ";
	video2= " ";
	video3= " ";
}

ostream& operator<<(ostream& osObject,const custType& customer)
{
	osObject<<endl;
	osObject<<"帐号:"<<customer.custAcctNo<<endl;
	osObject<<"姓名:"<<customer.lastName<<" "<<customer.firstName<<endl;
	osObject<<"所租影碟:1<"<<customer.video1 <<">;2<"<<customer.video2<<">;3<"<<customer.video3<<">"<<endl;                                          
    osObject<<"_____________________________________________"<<endl;
	return osObject;
}

bool custType::CustVideo(newString title)
{
	if(video1 == title)
		return true;
	else
	{
		if(video2 == title)
			return true;
		else
		{
			if(video3 == title)
				return true;
			else
				return false;
		}
	}
}

⌨️ 快捷键说明

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