本文整理汇总了C++中Student_info::did_all_hw方法的典型用法代码示例。如果您正苦于以下问题:C++ Student_info::did_all_hw方法的具体用法?C++ Student_info::did_all_hw怎么用?C++ Student_info::did_all_hw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student_info
的用法示例。
在下文中一共展示了Student_info::did_all_hw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
// students who did and didn't do all of their homework
vector<Student_info> did, didnt;
// read the students records and partition them
Student_info student;
while (student.read(cin)) {
if (student.did_all_hw())
did.push_back(student);
else
didnt.push_back(student);
}
// verify that the analysis will show us something
if (did.empty()) {
cout << "No student did all the homework!" << endl;
return 1;
}
if (didnt.empty()) {
cout << "Every student did all the homework!" << endl;
return 1;
}
// do the analyses
write_analysis(cout, "median", median_analysis, did, didnt);
write_analysis(cout, "average", average_analysis, did, didnt);
write_analysis(cout, "median of homework turned in", optimistic_median_analysis, did, didnt);
return 0;
}