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

  • 大小: 4.54MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-19
  • 語言: C/C++
  • 標簽: C++??course??

資源簡介

C++程序設計課程的作業,允許使用STL。功能要求是,有注冊學生、注冊課程、選課、退課的功能。大體實現思路是,對于每個課程和學生,用map保存其信息,靈活方便;為實現注冊功能,用指針線性表管理學生和課程,方便動態創建和統一析構;為實現選課和退課功能,維護學生和課程之間的二元關系及其逆關系(用指針序偶的集合實現)。可見,學生信息和課程信息在內存中是唯一的,選課和退課的操作都是對指針進行的,節省內存。注意,與硬盤交互的文件功能可能存在問題。

資源截圖

代碼片段和文件信息

#include?“pch.h“
#include?“Course.h“
#include?

const?char?Course::signature[30]?=?{?“Course“?};

Course::Course()
{
info[“ID“];
info[“name“];
info[“teacher“];
info[“domain“];
info[“time“];
info[“credit“];
info[“evaluation?mode“];
}


Course::operator?MyString()?const
{
MyString?_str(signature);
_str.append(“?“);
for?(auto?it?=?info.cbegin();
it?!=?info.cend();?it++)
{
_str.append(“{“);
_str.append(it->first);
_str.append(“:?“);
_str.append(it->second);
_str.append(“}?“);
}
return?_str;
}


Course::~Course()
{
}


Course::Course(const?Course?&?c)
{
ID?=?c.ID;
info?=?c.info;
}


Course?&?Course::operator=(const?Course?&?c)
{
ID?=?c.ID;
info?=?c.info;
return?*this;
}


void?Course::init()
{
std::cout?< MyString?value;
for?(auto?it?=?info.begin();
it?!=?info.end();?it++)
{
std::cout?<first?< getline(std::cin?value);
info[it->first]?=?value;
}
ID?=?info[“ID“];
}


void?Course::save(std::ofstream?&?os)?const
{
os?< for?(auto?it?=?info.cbegin();?it?!=?info.cend();?it++)
os?<first?<second?< os?<}


void?Course::restore(std::ifstream?&?is)
{
std::streampos?pos?=?is.tellg();
char?buff[300];
char?key[120];
char?value[130];
MyString?sig;
getline(is?sig);
if?(sig?==
MyString(signature))
{
is.getline(buff?300);
std::stringstream?ss(buff);
ss.ignore(300?‘{‘);
while?(!ss.eof())
{
ss.getline(key?120?‘:‘);
ss.getline(value?130?‘}‘);
info[MyString(key)]?=?MyString(value);
ss.ignore(300?‘{‘);
}
ID?=?info[“ID“];
}
else
is.seekg(pos);
}


MyString?Course::getID()?const
{
return?ID;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-12-22?08:59??CourseSelectionSystem\
?????目錄???????????0??2018-12-18?22:22??CourseSelectionSystem\.vs\
?????目錄???????????0??2018-12-18?22:22??CourseSelectionSystem\.vs\CourseSelectionSystem\
?????目錄???????????0??2018-12-28?19:49??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\
?????文件???????91648??2018-12-28?19:49??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\.suo
?????文件?????5967872??2018-12-28?19:49??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\Browse.VC.db
?????目錄???????????0??2018-12-28?19:43??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\ipch\
?????文件??????327680??2018-12-22?11:02??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\ipch\3d84e2152de53b30.ipch
?????文件??????327680??2018-12-28?19:44??CourseSelectionSystem\.vs\CourseSelectionSystem\v15\ipch\a75d1391a2f1a14f.ipch
?????目錄???????????0??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\
?????文件????????1476??2018-12-18?22:22??CourseSelectionSystem\CourseSelectionSystem.sln
?????文件????????1814??2018-12-28?10:05??CourseSelectionSystem\CourseSelectionSystem\Course.cpp
?????文件?????????460??2018-12-22?08:12??CourseSelectionSystem\CourseSelectionSystem\Course.h
?????文件?????????147??2018-12-20?15:17??CourseSelectionSystem\CourseSelectionSystem\courses.txt
?????文件????????6027??2018-12-28?10:04??CourseSelectionSystem\CourseSelectionSystem\CourseSelectionSystem.cpp
?????文件????????1053??2018-12-22?11:23??CourseSelectionSystem\CourseSelectionSystem\CourseSelectionSystem.h
?????文件????????8945??2018-12-19?14:06??CourseSelectionSystem\CourseSelectionSystem\CourseSelectionSystem.vcxproj
?????文件????????2335??2018-12-19?14:06??CourseSelectionSystem\CourseSelectionSystem\CourseSelectionSystem.vcxproj.filters
?????文件?????????165??2018-12-18?22:22??CourseSelectionSystem\CourseSelectionSystem\CourseSelectionSystem.vcxproj.user
?????目錄???????????0??2018-12-28?10:05??CourseSelectionSystem\CourseSelectionSystem\Debug\
?????文件??????619021??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\Course.obj
?????目錄???????????0??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\
?????文件???????15506??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\CL.command.1.tlog
?????文件??????144078??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\CL.read.1.tlog
?????文件????????7784??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\CL.write.1.tlog
?????文件?????????225??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\CourseSelectionSystem.lastbuildstate
?????文件????????5938??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\link.command.1.tlog
?????文件????????5988??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\link.read.1.tlog
?????文件????????1980??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSe.7C65D630.tlog\link.write.1.tlog
?????文件?????????408??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSelectionSystem.log
?????文件??????850299??2018-12-28?10:06??CourseSelectionSystem\CourseSelectionSystem\Debug\CourseSelectionSystem.obj
............此處省略29個文件信息

評論

共有 條評論