-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasscpp.cpp
More file actions
33 lines (28 loc) · 824 Bytes
/
classcpp.cpp
File metadata and controls
33 lines (28 loc) · 824 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
//class data mahasiswa yang menggunakan Constructor & Destructor
//pdf pertemuan 12 & 13 pada webkuliah
#include <iostream>
using namespace std;
class dataMhs {
public:
// Constructor
dataMhs() {
cout << endl << "Constructor - Data Mahasiswa" << endl;
}
// Destructor
~dataMhs() {
cout << endl << "Destructor - Data Pribadi Mahasiswa" << endl;
cout << "Hobi : Turu" << endl;
cout << "Umur : 19" << endl;
cout << "TTL : Tangerang - 29 Februari" << endl;
}
void datamhs() {
cout << "Nama : " << "Muhammad Akbar Hadi Pratama" << endl;
cout << "NIM : " << "237006516058" << endl;
cout << "Prodi : " << "Sistem Informasi" << endl;
}
};
int main() {
dataMhs show;
show.datamhs();
return 0;
}