1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
#include <string>
using namespace std;
class student {
public:
string student_name;
string student_id;
string student_age;
string student_address;
student(string student_name, string student_id, string student_age, string student_address ) :
student_name( student_name ),
student_id( student_id ),
student_age( student_age ),
student_address( student_address )
{}
void PrintInfo() {
cout << "Student Information" << endl;
cout << "Student Name: "<< student_name << endl;
cout << "Student ID: "<< student_id << endl;
cout << "Student Age: "<< student_age << endl;
cout << "Student Address: "<< student_address << endl;
cout << "" << endl;
return;
}
};
int main()
{
student student1("Student 01", "ID001", "Age01", "Address01");
student student2("Student 02", "ID002", "Age02", "Address02");
student student3("Student 03", "ID003", "Age03", "Address03");
student1.PrintInfo();
student2.PrintInfo();
student3.PrintInfo();
}
|