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

📄 classmethods.cpp

📁 超市收银
💻 CPP
字号:
#include <cstring>
#include "SupMakt.h"

// Class Goods_Info's methods
Goods_Info::Goods_Info(const int kd,
					   const char * nm,
					   double pri,
					   int num,
					   const char * con_date,
					   int ht,
					   double inpri,
					   int total_num,
					   double total_pri,
					   double in_total_pri,
					   double profi,
					   double profied){
	
	kind = kd;
	strncpy(name, nm, NAME - 1);
	name[NAME - 1] = '\0';
	price = pri;
	number = num;
	strncpy(conserve_date, con_date, 10);
	conserve_date[10] = '\0';
	has_it = ht;
	
	inprice = inpri;
	total_number = total_num;
	total_price  = total_pri;
	in_total_price = in_total_pri;
	profit = profi;
	profited = profied;
}

// Class Foodstuff's methods
Foodstuff::Foodstuff(const int kd,
					 const char * nm,
					 double pri,
					 int num,
					 const char * con_date,
					 int ht,
					 
					 double inpri,
					 int total_num,
					 double total_pri,
					 double in_total_pri,
					 double profi,
					 double profied,
					 const char * sm):Goods_Info(kd, nm, pri, num, con_date, ht, inpri,
					 total_num, total_pri, in_total_pri, profi, profied){

	strncpy(smell, sm, SMELL - 1);
	smell[SMELL - 1] = '\0';
}

⌨️ 快捷键说明

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