91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

C++語言寫的,控制臺模式的,本人親寫,可用來略作借鑒,保證完整可運行

資源截圖

代碼片段和文件信息

#include
using?namespace?std;
#include?
#include?“student.h“
#include?“course.h“
#include?“attendance.h“

#define?stu_Max?100?//學生數組的大小
#define?course_Max?100

bool?findStudent(student?studs[]?int?stuId?int*?stuIndex)
{
for?(int?i?=?0;?i {
*stuIndex?=?i;
if?(studs[i].getStuId()?==?stuId)//找到該學生
{
return?true;
}
//if?(studs[i].getStuName()?==?NULL)//未找到該學生
//{

//}
}
return?false;
}

bool?findCourse(course?cos[]?string?courseName?int*?courseIndex)
{
for?(int?i?=?0;?i {
*courseIndex?=?i;
if?(cos[i].getCourseName()?==?courseName)//找到該課程
{
return?true;
}
//if?(cos[i].getCourseName()?==?NULL)//未找到該課程
//{

//}
}
return?false;
}

int?findMax(int?sum[]?int*?maxIndex)//返回數組中最大值及其下標并將最大值設為0
{
int?max?=?sum[0];
*maxIndex?=?0;
for?(int?i?=?0;?i {
if?(max {
max?=?sum[i];
*maxIndex?=?i;
}
}
sum[*maxIndex]?=?0;
return?max;
}

bool?addStuAttendRecord(student?studs[]?course?cos[])//添加學生考勤記錄
{
if?(studs?==?NULL?||?cos?==?NULL)
return?false;
int?stuId;
string?stuName;
string?courseName;
cout?< cout?< cin?>>?stuId;
cout?< cin?>>?stuName;
cout?< cin?>>?courseName;

int?stuIndex;
if?(!findStudent(studs?stuId?&stuIndex))////未找到該學生錄入學生信息
{
cout?< studs[stuIndex].initStudent();
}
int?courseIndex;
if?(!findCourse(cos?courseName?&courseIndex))//未找到該課程,錄入該課程信息
{
cout?< cos[courseIndex].initCourse();
}

attendance*?attend?=?new?attendance();
cout?< attend->initAttend(studs[stuIndex].getStuId()?cos[courseIndex].getCourseId()?cos[courseIndex].getCourseName());

studs[stuIndex].addAttendance(attend);
return?true;
}

bool?changeStuAttendRecord(student?studs[]?course?cos[])//修改某個學生的考勤記錄
{
cout?< int?stuId;
string?stuName;
string?courseName;
int?year;
int?month;
int?day;
cout?< cin?>>?stuId;
cout?< cin?>>?stuName;
cout?< cin?>>?courseName;

int?stuIndex;
if?(!findStudent(studs?stuId?&stuIndex))
{
cout?< return?false;
}

int?courseIndex;
if?(!findCourse(cos?courseName?&courseIndex))
{
cout?< return?false;
}

cout?< cout?< cin?>>?year;
cout?< cin?>>?month;
cout?< cin?>>?day;
double?attendId?=?countAttendId(year?month?day);

attendance*?attendPoint?=?new?attendance();
if?(studs[stuIndex].findAttendRecord(attendId?attendPoint))//通過出勤id查找該記錄
{
cout?< studs[stuIndex].showStudent();
cos[courseIndex].showCourse();
attendPoint->showAttendRecord();
}
else
{
cout?< return?false;
}

int?choice?=?0;
while?(choice?!=?4)
{

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????8633??2018-06-03?18:21??attendanceSystem.cpp
?????文件????????2362??2018-06-03?16:30??course.h
?????文件????????2476??2018-06-03?16:47??student.h
?????文件????????2698??2018-06-03?16:30??attendance.h

評論

共有 條評論