本文整理汇总了C++中Student::GPA方法的典型用法代码示例。如果您正苦于以下问题:C++ Student::GPA方法的具体用法?C++ Student::GPA怎么用?C++ Student::GPA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::GPA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
string fname, lname;
float gpa;
int credits;
Student MyStudent;
cout << "Enter First and Last Name, GPA, and Credits Taken" << endl;
cin >> fname >> lname >> gpa >> credits;
MyStudent.FirstName(fname);
MyStudent.LastName(lname);
MyStudent.GPA(gpa);
MyStudent.Credits(credits);
cout << setprecision(1) << fixed;
cout << setw(30) << left << "Student First Name:" << setw(30) << left << MyStudent.FirstName() << endl;
cout << setw(30) << left << "Student Last Name:" << setw(30) << left << MyStudent.LastName() << endl;
cout << setw(30) << left << "Student GPA:" << setw(30) << left << MyStudent.GPA() << endl;
cout << setw(30) << left << "Student Credits Taken:" << setw(30) << left << MyStudent.Credits() << endl;
cout << setw(30) << left << "Student Standing:" << setw(30) << left << MyStudent.Standing() << endl;
system("pause");
return 0;
}
示例2: Person
// Student::Student ///////////////////////////////////////
Student::Student(const Student &s) : Person(s)
{
if (Student::Debug())
{
Student::DebugHeader();
cout << "Inside of Student::Student() COPY constructor." << endl;
}
GPA(s.GPA());
if (Student::Debug())
{
cout << "GPA has been set to " << GPA() << '\n';
cout << "Leaving Student::Student() COPY constructor." << endl;
Student::DebugFooter();
}
}