编辑: GXB156399820 | 2013-06-08 |
2.2.2改进二 2.2.2.1 改进方案 增加时间单元的存储与显示:在结点数据域中增加一个时间单元,在结点数据的构造函数中调用系统时间给时间单元赋值. 2.2.2.2 具体实现 void setTime() { time_date=time(0);
CurrentTime=localtime(&time_date);
Year=CurrentTime->tm_year+1900;
Month=CurrentTime->tm_mon+1;
Day=CurrentTime->tm_mday;
Hour=CurrentTime->tm_hour;
Minute=CurrentTime->tm_min;
} int getYear() {return Year;
int getMonth() {return Month;
int getDay() {return Day;
int getHour() {return Hour;
int getMinute() {return Minute;
void setRecord(char*lastname,char*number,char*firstname, int year,int month,int day,int hour,int minute ) { strcpy(LName,lastname);
strcpy(Tel,number);
strcpy(FName,firstname);
Year=year;
Month=month;
Day=day;
Hour=hour;
Minute=minute;
} 2.2.3改进三 2.2.3.1 改进方案 使用户界面更加友好:避免输入数据类型错误导致程序无效循环或终止,在输入数据类型时进行判断,对非法输入予以提示. 2.2.3.2 具体实现 //要求用户确认函数 int List::verify_delete( { char YesNo;
cout