Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Refrence program
- #include <iostream>
- #include<fstream>
- using namespace std;
- int main()
- { // beginning of main function
- int name;
- int Choice;
- char Entry[120] = {'\0'};
- char Entry1[120] = {'\0'};
- int Second_Entry;
- int Choice_1;
- ofstream Entry_storage;
- ofstream Entry_storage1;
- ofstream Entry_storage2;
- ofstream Entry_storage3;
- ofstream Entry_storage4;
- ofstream Entry_storage5;
- ofstream Entry_storage6;
- ofstream Entry_storage7;
- ofstream Entry_storage8;
- ofstream Entry_storage9;
- ofstream Entry_storage10;
- Begin:
- cout<<"\t\t Refrence Entry 1.0, Created by Frosty\n";
- cout<<" \tRead the Readme.txt before Using this program!\n";
- cout<<"\n\n";
- cout<<"Welcome to the Reference Program, what would you like to do ?\n\n\n";
- cout<<" 1. Create an Entry\n";
- cout<<" 2. View an Entry\n";
- cout<<" 3. Delete an Entry\n\n";
- cout<<"Choice: ";
- cin>>Choice;
- cin.get();
- switch (Choice)
- {
- case 1:
- system("CLS");
- cout<<"What number entry is this ?(Type the numer of the entry)\n";
- cout<<"(You can only store up to 10 Entrys)\n\n";
- cin>>name;
- cin.get();
- switch(name)
- {
- case 1:
- Entry_storage1.open("Entry 1.txt");
- Entry_storage1<<Entry1;
- Entry_storage1.close();
- cout<<"Your Entry will be saved to Entry 1.txt";
- cin.get();
- break;
- case 2:
- Entry_storage2.open("Entry2.txt");
- Entry_storage2.close();
- cout<<"Your Entry will be saved to Entry 2.txt";
- cin.get();
- break;
- case 3:
- Entry_storage3.open("Entry 3.txt");
- Entry_storage3<<Entry;
- Entry_storage3.close();
- cout<<"Your Entry will be saved to Entry 3.txt";
- cin.get();
- break;
- case 4:
- Entry_storage4.open("Entry 4.txt");
- Entry_storage4<<Entry;
- Entry_storage4.close();
- cout<<"Your Entry will be saved to Entry 4.txt";
- cin.get();
- break;
- case 5:
- Entry_storage5.open("Entry 5.txt");
- Entry_storage5<Entry;
- Entry_storage5.close();
- cout<<"Your Entry will be saved to Entry 5.txt";
- cin.get();
- break;
- case 6:
- Entry_storage6.open("Entry 6.txt");
- Entry_storage6<<Entry;
- Entry_storage6.close();
- cout<<"Your Entry will be saved to Entry 6.txt";
- cin.get();
- break;
- case 7:
- Entry_storage7.open("Entry 7.txt");
- Entry_storage7<<Entry;
- Entry_storage7.close();
- cout<<"Your Entry will be saved to Entry 6.txt";
- cin.get();
- break;
- case 8:
- Entry_storage8.open("Entry 8.xt");
- Entry_storage8<<Entry;
- Entry_storage8.close();
- cout<<"Your Entry will be saved to Entry 6.txt";
- cin.get();
- break;
- case 9:
- Entry_storage9.open("Entry 9.txt");
- Entry_storage9<<Entry;
- Entry_storage9.close();
- cout<<"Your Entry will be saved to Entry 6.txt";
- cin.get();
- break;
- case 10:
- Entry_storage10.open("Entry 10.txt");
- Entry_storage10<<Entry;
- Entry_storage10.close();
- cout<<"Your Entry will be saved to Entry 10.txt";
- cin.get();
- break;
- }
- system("CLS");
- cout<<"\n\n";
- cout<<"Press Enter to being Entry";
- cin.get();
- system("CLS");
- cout<<" Start typing your entry here ( up to 120 characters)\n\n";
- cout<<" Press Enter once you've completed Entry\n\n";
- cin.get(Entry1, 119);
- cin.get();
- cout<<" Entry saved to Entry.txt \n\n";
- cin.get();
- system("CLS");
- cout<<" What would you like to do now?\n\n";
- cout<<"5. View Entry\n";
- cout<<"6. Back to Main menu\n";
- cout<<"7. Delete Entry\n";
- cout<<"\n\n";
- cin.get();
- cin>>Second_Entry;
- Entry_storage.open("Entry 1.txt");
- Entry_storage<<Entry;
- Entry_storage.close();
- cin.get();
- if (Second_Entry == 6)
- {
- system("CLS");
- goto Begin;
- }
- switch(Second_Entry);
- {
- case 5:
- system("CLS");
- cout<<"Entry "<<name;
- cout<<"\n\n";
- cout<<Entry;
- cin.get();
- system("CLS");
- cout<<"What would you like to do now?\n\n";
- cout<<"7. Main Menu\n";
- cout<<"8. Exit Program\n\n";
- cin>>Choice_1;
- if(Choice_1 == 7)
- { system("CLS");
- goto Begin;
- }
- else if(Choice_1 == 8)
- { Exit:
- cout<<"Exiting";
- }
- }
- case 2:
- system("CLS");
- cout<<"Please enter the full name of the Entry (The .txt)\n\n";
- cin.get();
- }
- }
- // end of main function
Add Comment
Please, Sign In to add comment