#include <iostream.h>
#include <fstream.h>
#include <conio.h>
void main()
{
clrscr();
int x;
char y[100],a[100],b[100],c[100],d[100],e[100];
cout << "CHOICE YOU WANT" << endl << endl;
cout << "1. Create File.txt In your Drive" << endl;
cout << "2. Fill Text in File.txt" << endl;
cout << "3. Add Word In Your File.txt" << endl;
cout << "4. Remove All text In File.txt" << endl;
cout << "5. EXIT" << endl << endl;
cout << "Your Number : ", cin >> x;
if (x == 1)
{
ofstream textbaru;
cout << "Input File Name and Location File" << endl;
cout << "example :" << endl;
cout << "C:/fileame.txt" << endl;
cout << "D:/fileame.txt" << endl;
cout << "E:/fileame.txt" << endl;
cout << "C:/fileame.cpp" << endl;
cout << "D:/fileame.php" << endl << endl;
cout << "In Here : ", cin >> y;
textbaru.open(y);
textbaru.close();
cout << "Ok.. Done.. Look On Your Drive";
getch();
}
if (x == 2)
{
ofstream textbaru;
cout << "Frist You Must Open Your File" << endl;
cout << "example :" << endl;
cout << "C:/fileame.txt" << endl;
cout << "D:/fileame.txt" << endl;
cout << "E:/fileame.txt" << endl << endl;
cout << "In Here : ", cin >> y ;
textbaru.open(y);
cout << endl;
cout << "Enter Your Word Without Space" << endl << endl;
cout << "1. ", cin >> a;
cout << "2. ", cin >> b;
cout << "3. ", cin >> c;
cout << "4. ", cin >> d;
cout << "5. ", cin >> e;
textbaru << a << endl;
textbaru << b << endl;
textbaru << c << endl;
textbaru << d << endl;
textbaru << e << endl;
textbaru.close();
cout << "Ok.. Done.. Look On Your Drive";
getch();
}
if (x ==3)
{
ofstream textbaru;
cout << "Frist You Must Open Your File" << endl;
cout << "example :" << endl;
cout << "C:/fileame.txt" << endl;
cout << "D:/fileame.txt" << endl;
cout << "E:/fileame.txt" << endl << endl;
cout << "In Here : ", cin >> y ;
textbaru.open(y, ios::app);
cout << endl;
textbaru<<endl;
cout << "Enter Your Word Without Space" << endl << endl;
cout << "1. ", cin >> a;
cout << "2. ", cin >> b;
cout << "3. ", cin >> c;
cout << "4. ", cin >> d;
cout << "5. ", cin >> e;
textbaru << a << endl;
textbaru << b << endl;
textbaru << c << endl;
textbaru << d << endl;
textbaru << e << endl;
textbaru.close();
cout << "Ok.. Done.. Look On Your Drive";
getch();
}
if (x == 4)
{
ofstream textbaru;
cout << "WARNING !!! Existing Word Lost" << endl << endl;
cout << "Frist You Must Open Your File" << endl;
cout << "example :" << endl;
cout << "C:/fileame.txt" << endl;
cout << "D:/fileame.txt" << endl;
cout << "E:/fileame.txt" << endl << endl;
cout << "In Here : ", cin >> y ;
textbaru.open(y, ios::trunc);
textbaru.close();
cout << "Ok.. Done.. Look On Your Drive";
getch();
}
if (x == 5)
getch();
}
Download Source Code...
Download File.cpp >> Link
Download File.doc >> Link
No comments:
Post a Comment