forked from IT1050-2022-Feb/ooc-project-IT21313370
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudent.cpp
55 lines (49 loc) · 1.29 KB
/
Student.cpp
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
44
45
46
47
48
49
50
51
52
53
54
55
//IT21266546
#include "Student.h"
#include "GuestUser.h"
#include <iostream>
#include <cstring>
using namespace std;
Student::Student()
{
studentID = 0;
studentAge = 0;
strcpy(userName, "");
strcpy(userAddress, "");
strcpy(userEmail, "");
userContactNo = 0;
userID = 0;
strcpy(country, "");
}
//Student is a Guest User
//Inheritance
Student::Student(const char pName[50], const char pAddress[50], const char pEmail[30], int pContactNo, int pUserID, const char pCountry[20], int pStudentID, int pStudentAge) : GuestUser(pName, pAddress, pEmail, pContactNo, pUserID, pCountry)
{
studentID = pStudentID;
studentAge = pStudentAge;
strcpy(userName, pName);
strcpy(userAddress, pAddress);
strcpy(userEmail, pEmail);
userContactNo = pContactNo;
userID = pUserID;
strcpy(country, pCountry);
}
//Function Overriding
void Student::displayUserDetails()
{
cout << "Student ID: " << studentID << endl;
cout << "Student Age: " << studentAge << endl;
cout << "Name : " << userName << endl;
cout << "Address : " << userAddress << endl;
cout << "Email : " << userEmail << endl;
cout << "ContactNo : " << userContactNo << endl;
cout << "User ID: " << userID << endl;
cout << "Country name : " << country << endl;
}
void displayOrderDetails()
{
}
Student::~Student()
{
cout << "Student deleted" << endl;
}