-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetdata
More file actions
42 lines (38 loc) · 868 Bytes
/
Setdata
File metadata and controls
42 lines (38 loc) · 868 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
void Pinjam::setData(){
char next;
do{
ifstream data_buku;
data_buku.open("List Buku.txt");
string jud, pen, nam, ala, no, kela, baru2, get;
cout<<"Masukkan nama : ";
getline(cin, nam);
cout<<"Masukkan alamat : ";
getline(cin, ala);
cout<<"Masukkan no HP : ";
getline(cin, no);
cout<<"Masukkan jenis kelamin : ";
getline(cin, kela);
cout<<"Masukkan judul buku : ";
getline(cin, jud);
while(!data_buku.eof()){
getline(data_buku, baru2);
if(baru2.find(jud)==8){
break;
}
else if( data_buku.eof() && baru2.find(jud)!=8){
cout<<"Data tidak ditemukan"<<endl;
system("pause");
exit(0);
}
}
cout<<"Masukkan penulis buku : ";
getline(cin, pen);
cout<<"Tambahkan data lagi <y/n> : ";
cin>>next;
cin.ignore();
Pinjam p1(jud, pen, nam, ala, no, kela);
system("cls");
p1.getscreen();
p1.saveFile();
} while(next == 'y');
}