-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_CPP_CLASSES.cpp
40 lines (31 loc) · 978 Bytes
/
08_CPP_CLASSES.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
/////////////////////////////////////////
// WELCOME TO C++ PROGRAMMING! - 2019 //
/////////////////////////////////////////
/* This Code is Written By Ugur Uresin For training purposes! */
/*
To compile the program: g++ filename.cpp -o executableName
To execute the program: ./executableName
*/
// -------------------------------------------------- //
// 08 - CLASSES
// -------------------------------------------------- //
/* Example
Functions in classes are also called methods.
Recall the default for members in a class is private.
We want the access functions to be public.
So we add the keyword "public" and all members listed
after it are accessible*/
class Student
{
string name;
int id;
int gradDate;
public:
void setName(string nameIn);
void setId(int idIn);
void setGradDate(int dateIn);
string getName();
int getId();
int getGradDate();
void print();
};