Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IMAGE 1 : http://prntscr.com/59ag30
- //IMAGE 2 : http://prntscr.com/59agjj
- //coding nya :
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- //#include <stdio>
- //#include <windows>
- #include <conio.h>
- using namespace std;
- void TambahData()
- {
- string baca;
- string inputData;
- int confi;
- system("cls");
- string nama, alamat, nope;
- cout <<"BETA VERSION\n"<<endl;
- cout << "Masukkan Nama : ";
- getline(cin,nama);
- cout << "Masukkan Alamat : ";
- getline(cin,alamat);
- cout << "Masukkan Nomor HP : ";
- getline(cin,nope);
- inputData ="Nama Calon Anggota\t: "+nama+"\n" "Alamat Calon Anggota\t: "+alamat+"\n" "No.HP Calon Anggota\t: "+nope+"\n\n";
- ofstream baru;
- baru.open("data.txt",ios::app); //membuka file data.txt
- baru << inputData; //menambah dan menyimpan data ke file data.txt
- baru.close(); //menutup file data.txt
- cout << "\nData telah ditambah!!!"<<endl;
- cout << "Apakah anda akan menginput kembali?? (1 = ya || 2 = tidak) ";
- cin>>confi;
- if(confi==1){
- TambahData();
- }
- if(confi==2){
- getch;
- }
- }
- int main()
- {
- TambahData(); //memanggil void TambahData
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement