Please post your compiler output ( the errors)
These are some of the things I can see:
In general you need to split your code into functions. There is a bit of a rule that a function should not be more than 80 lines of code. And no more than 80 chars per line of code. You should have a function that prints the menu and then another to get a response and call the appropriate function to carry out the menu option. The processing of the menu option should be a switch statement, with each case calling a function.
You have a lot of these:
}while(menu_choice_1=='y'|menu_choice_1=='Y');
You need to use the || (Or operator) not |
If you make use of the toupper function (converts a char to upper case) you won't have to test the variable twice.
I personally dislike do loops, here is a better way of quitting from something:
1 2 3 4 5 6 7 8
|
bool Quit = false;
while (!Quit) {
//your code
//user wants to quit
Quit = true;
}
|
Also with variable names - I like to use CamelCase. No underscores - they make the name too long, capitalise the first letter of each word.
Now with your objects, To process multiple students, create a student object then use push_back to put it into a vector. This way you can store all the info.
With this:
if(main_menu_choice!=0||main_menu_choice!=1||main_menu_choice!=2||main_menu_choice!=3||main_menu_choice!=4)
What if you had 15 menu options? There has to be a better way. Hint - the switch statement I mentioned earlier.
Hope all goes well.
edit:
You can build up the cout in stages - it doesn't have to be all on one giant long line - like this:
1 2 3 4 5 6 7 8
|
cout<<"Do you want to?\n";
cout << "1.Access basic student information.\n";
cout << "2.Access secure student information.(*)\n";
cout << "3.Edit the database.(*)\n";
cout << "4.Append to the database.(*)\n";
cout << "0.Create a new Database-Deletes the existing database(*)" << endl;
cout<<"\nEnter your choice (1/2/3/4/0)\t" << endl;
|
You should also have an option to end the program on the menu. And as I said earlier the whole thing should be in a function.