I need help in c++ program

I am Beginner in c++
and I want to make this program but I cannot so I want help



---Welcome in my TEXT PROCESSOR application---
----------------Mohammad Hajjaj----------------

1- Enter File Name.
2- Print Contents.
3- Count Lines.
4- Find Longest. Word
5- Replace Word.
6- Delete Line.
7- Save File.
8- Save As A newer File.
9- Exit.

Choose Your choice:



I do only this


#include<iostream>
#include <fstream>
#include <string>
using namespace std;

int main(){
int x;
ifstream inFile;
cout<<"---Welcome in my TEXT PROCESSOR application--- \n"
<<"----------------Mohammad Hajjaj---------------- \n"
<<" \n"
<<"1- Enter File Name. \n"
<<"2- Print Contents. \n"
<<"3- Count Lines. \n"
<<"4- Find Longest. Word \n"
<<"5- Replace Word. \n"
<<"6- Delete Line. \n"
<<"7- Save File. \n"
<<"8- Save As A newer File. \n"
<<"9- Exit. \n"
<<" "<<endl;

cout<<"Choose Your choice: ";
cin>>x;

if (x==1)
{string fName;
cout << "Enter File name to open: ";
cin >> fName;
inFile.open( fName.c_str() );
}
else if(x==2){
inFile.open( fName.c_str() );

}
else if(x==3){
inFile.open( fName.c_str() );
}
else if(x==4){
inFile.open( fName.c_str() );
}
else if(x==5){
inFile.open( fName.c_str() );
}
else if(x==6){
inFile.open( fName.c_str() );
}
else if(x==7){
inFile.open( fName.c_str() );
}
else if(x==8){
inFile.open( fName.c_str() );
}
else if(x==9){
return 0;
}



system("pause");
return 0;
}
Last edited on
Please note that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.
What part of it are you currently working on and what is your question about it?
Topic archived. No new replies allowed.