-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.cpp
More file actions
62 lines (55 loc) · 1.12 KB
/
Copy pathStudent.cpp
File metadata and controls
62 lines (55 loc) · 1.12 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
56
57
58
59
#include "Student.h"
#include <iostream>
using namespace std;
void Student::setStudentData()
{
cout << "Enter Student ID: ";
cin >> studentID;
cin.ignore();
cout << "Enter Name: ";
getline(cin, name);
cout << "Enter Age: ";
cin >> age;
cin.ignore();
cout << "Enter Department: ";
getline(cin, department);
cout << "Enter Semester: ";
cin >> semester;
cout << "Enter CGPA: ";
cin >> cgpa;
cout << '\n';
}
void Student::displayStudent()
{
cout << "\n========== Student Details ==========\n";
cout << "Student ID : " << studentID << endl;
cout << "Name : " << name << endl;
cout << "Age : " << age << endl;
cout << "Department : " << department << endl;
cout << "Semester : " << semester << endl;
cout << "CGPA : " << cgpa << endl;
}
int Student::getStudentID()
{
return studentID;
}
string Student::getName()
{
return name;
}
int Student::getAge()
{
return age;
}
string Student::getDepartment()
{
return department;
}
int Student::getSemester()
{
return semester;
}
float Student::getCGPA()
{
return cgpa;
}