-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.cpp
More file actions
56 lines (43 loc) · 1.68 KB
/
student.cpp
File metadata and controls
56 lines (43 loc) · 1.68 KB
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
#include <iostream>
#include<vector>
class student
{
private:
friend class Enrollment;
static int student_count;
int mobile_number;
unsigned short int courses_count=0;
protected:
std :: vector<int> courses;
std :: string name;
std :: string roll_number;
struct dob
{
int day = 0;
int month = 0; // if we see these value 0 then we can use it for error handling
int year = 0;
}stud;
public:
student (void) {/*do nothing constructor*/};
student (std::string name, std :: string roll_number, int day_dob, int month_dob, int year_dob, int mobile_number)
{
this->name =name;
this->roll_number = roll_number;
this->mobile_number = mobile_number;
stud.day = day_dob;
stud.month = month_dob;
stud.year = year_dob;
student_count++;
}
void getdata();
};
int student :: student_count = 0;
void student :: getdata()
{
std :: cout << "---------------------------------------------" << std :: endl;
std :: cout << "Student Name :: " << name << std :: endl;
std :: cout << "Student Roll number :: " << roll_number << std :: endl;
std :: cout << "Student Date of Birth is :: " << stud.day << "/" <<stud.month << "/" <<stud.year<< std :: endl;
std :: cout << "Student Mobile number is :: " << mobile_number << std :: endl << std :: endl;
std :: cout << "---------------------------------------------" << std :: endl;
}