Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- string this_step;
- string total_code;
- int choice;
- string text;
- cout<<"Hello , I am zero005 , a bot developed by Ahmed Saber , to help you create a c++ app easily , as I will give you the source code of the app you want to create , but first you must tell me all about this app..."<<endl<<endl<<endl;
- // preparing libraries
- again:
- cout<<"First step , here I want to know what you want to use."<<endl<<"Choose by only typing the number of choice then pressing Enter"<<endl<<"1- I want to print text on the screen"<<endl<<"10- I added everything , Let's go to next step"<<endl;
- cin>>choice;
- if (choice==1)
- {
- this_step="#include <iostream> using namespace std;";
- total_code=total_code+this_step;
- goto again;
- }
- else if (choice==10)
- {
- this_step="int main() {";
- total_code=total_code+this_step;
- }
- // let's ask the user about what will be done first then second ...etc
- one_more:
- cout<<endl<<"choose a step to be done"<<endl<<"1- print something"<<endl;
- cin>>choice;
- if (choice==1)
- {
- cout<<"Enter the text you want the app to print (Type without using space)"<<endl;
- cin>>text;
- this_step="cout<<'"+text+"'<<endl;";
- total_code=total_code+this_step;
- }
- // end
- total_code=total_code+"}";
- // create a text file with the source code
- ofstream MyFile("source code.txt");
- MyFile<<total_code;
- MyFile.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment