本文整理汇总了C++中Students::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Students::getName方法的具体用法?C++ Students::getName怎么用?C++ Students::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Students
的用法示例。
在下文中一共展示了Students::getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Teachers aTeacher;
Students aStudent;
GuestTeachers aGuestTeacher;
int option = 0;
int identity;
int Points;
if (Points < 0 || Points > 100)
{
cout << "Bad input! " << endl;
}
int EvaluationMark;
if(EvaluationMark < 2 && EvaluationMark >6)
{
cout << "Bad input! " << endl;
}
int MonthlySalary;
int passedDays;
int SalaryForCourse;
string Name;
string Course;
cout << "Get data for student with ID: 1" << endl;
cout << "Get data for teacher with ID: 2" << endl;
cout << "Get data for guest teacher with ID: 3" << endl;
cout << "Add data for new student: 4" << endl;
cout << "Add data for new teacher: 5" << endl;
cout << "Add data for new guest teacher: 6" << endl;
unsigned short int arr[65535];
while(true)
{
cout << "Enter option: ";
cin >> option;
{
if(option == 7)
{
break;
}
if (option < 1 || option > 7)
{
cout << "Bad input! " << endl;
}
switch(option)
{
case 1:
cout << aStudent.getID() << endl;
cout << aStudent.getName() << endl;
cout << aStudent.getCurrentCourse() << endl;
cout << aStudent.getCurrentPoints() << endl;
cout << aStudent.getAverageEvaluationMark() << endl;
break;
case 2:
cout << aTeacher.getID() << endl;
cout << aTeacher.getName() << endl;
cout << aTeacher.getCurrentCourse() << endl;
cout << aTeacher.getMonthlySalary() << endl;
cout << aTeacher.getPassedDays() << endl;
break;
case 3:
cout << aGuestTeacher.getID() << endl;
cout << aGuestTeacher.getName() << endl;
cout << aGuestTeacher.getCurrentCourse() << endl;
cout << aGuestTeacher.getSalaryForCourse() << endl;
break;
case 4:
cout << "Enter ID, Name, Current Course , Current Points and Average Evaliation Mark: "<< endl;
cin >> identity >> Name >> Course >> Points >> EvaluationMark;
aStudent.setID(identity);
aStudent.setName(Name);
aStudent.setCurrentCourse(Course);
aStudent.setCurrentPoints(Points);
aStudent.setAverageEvaluationMark(EvaluationMark);
cout << "A student profile has been added." << endl;
break;
case 5:
cin >> identity >> Name >> Course >> MonthlySalary >> passedDays;
aTeacher.setID(identity);
aTeacher.setName(Name);
aTeacher.setCurrentCourse(Course);
aTeacher.setMonthlySalary(MonthlySalary);
aTeacher.setPassedDays(passedDays);
cout << "A teacher profile has been added." << endl;
break;
case 6:
cin >> identity >> Name >> Course >> SalaryForCourse;
aGuestTeacher.setID(identity);
aGuestTeacher.setName(Name);
aGuestTeacher.setCurrentCourse(Course);
aGuestTeacher.setSalaryForCourse(SalaryForCourse);
cout << "A guest teacher profile had been added." << endl;
break;
}
}
}
return 0;
//.........这里部分代码省略.........