-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathBai46.cpp
More file actions
74 lines (51 loc) · 789 Bytes
/
Bai46.cpp
File metadata and controls
74 lines (51 loc) · 789 Bytes
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Tổng quan về class trong C++
- Lý do cần phải có class
- Định nghĩa class
- Tổng quát cú pháp tạo class
- Object tạo ra từ class
- Cách sử dụng class
*/
#include <iostream>
using namespace std;
class Student {
public:
char ID[20];
char name[100];
int age;
float mark;
char address[100];
void showIdCard() {
}
void study(char *subject) {
}
void doExample(char* subjName) {
}
void payFee(float amount) {
}
};
class Cat {
public:
char name[100];
int age;
float weight;
char color[100];
char eyesColor[100];
void move() {
}
void sleep() {
}
void eat() {
}
void speak() {
}
};
int main() {
Student s1;
s1.mark = 8.5;
s1.age = 20;
cout << "Age: " << s1.age << endl;
Cat cat;
cat.name;
return 0;
}