#ifndef?MAIN_C #define?MAIN_C #include? #include? #include? #include? #include? #include? #include?“Teacher.h“ int?main?() { cout?<“Welcome?to?Teacher‘s?Course?Elect?System!\n“?< string?course_name; int?course_id; int?course_weekly_hours; int?course_total_hours; int?course_priority; ????????multimap??courses; cout?<“Enter?course?name:?“?< while?(cin?>>?course_name)?{ if?(course_name.compare(“0“)?==?0)?{ break; } ????????????????cout?<“Enter?course?number:?“?<????????????????cin?>>?course_id; ????????????????cout?<“Enter?course?weekly?hours:?“?<????????????????cin?>>?course_weekly_hours; ????????????????cout?<“Enter?course?total?hours:?“?<????????????????cin?>>?course_total_hours; if?(course_total_hours? cerr?<“ERROR:?total?hours?should?be?greater?than?weekly?hours!“?<???????????????? cout?<“Enter?course?total?hours:?“?< cin?>>?course_total_hours; }? ????????????????cout?<“Enter?course?priority:?“?<????????????????cin?>>?course_priority; ????????????????COURSE*?c?=?new?COURSE(course_name?course_id?course_weekly_hours course_total_hours?course_priority); courses.insert(pair(course_priority?c)); cout?<“Enter?next?course?name?(0?to?end):?“?< } multimap?::iterator?it;?? cout?<“Summary?of?courses:?“?< for?(?it?=?courses.begin();?it?!=?courses.end();?it++)?{ cout?<“Course?number:?“?<second->get_course_number()? ?????<“?Course?name:?“?<second->get_course_name()? ?????<“?Course?priority:?“?<second->get_course_priority()? ?????<“?Weekly?hours:?“?<second->get_weekly_hours()? ?????<“?Total?hours:?“?<second->get_total_hours()? ?????< } cout?< ????????map??teachers; ????????string??teacher_name; ????????int?? teacher_id; ????????int?????desired_total_hours; int? expectation; ????????cout?<“Enter?teacher‘s?information:?“?< cout?<“Enter?teacher‘s?name:?“?<????????while?(cin?>>?teacher_name)?{ if?(teacher_name.compare(“0“)?==?0)?break;? cout?<“Enter?teacher‘s?id:?“?< cin?>>?teacher_id; cout?<“Enter?teacher?“?< cin?>>?desired_total_hours; TEACHER*?t?=?new?TEACHER(teacher_name?teacher_id?desired_total_hours); cout?<“Enter?teacher?“?< cout?<“Course?name:?“?< while?(cin?>>?course_name)?{ if?(course_name.compare(“0“)?==?0)?break;? bool?found?=?false; for?(?it?=?courses.begin();?it?!=?courses.end();?it++)?{ if?(it->second->get_course_name()?==?course_name)?{ found?=?true; break; } } if?(!found)?{? cerr?<“Selected?course?is?not?offered.?Enter?another?course!“?< continue; }
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-09-21?23:19??教師排課系統(tǒng)(課程設(shè)計)\
?????文件????????6268??2011-09-02?08:30??教師排課系統(tǒng)(課程設(shè)計)\main.cpp
?????文件????????2147??2011-09-02?07:47??教師排課系統(tǒng)(課程設(shè)計)\Teacher.h