Menu driven program

MENU DRIVEN PROGRAM

 In the previous blog of this series we have came to know basic framework of our project.It includes the functionalities with which a user is going to work and his/her scope in accessing those functionalities etc.
In this blog we are going to discuss the menu driven program of our project. Basically it defines our project .
     
 So Menu driven program is a program that obtains input from a user by displaying a list of options which is nothing but the menu from which the  user indicating his or her choice .There are many examples of menu driven program. Let us take example of bank cash dispensers.In that case single keys are pressed to indicate the type of transaction
whether a receipt is wanted with the cash, or if a statement of the bank balance is required and with many, a single key is pressed to indicate the amount of money required.

There are advantages of menu driven program.Firstly, because input is via single key strokes, the system is less prone to user error; secondly, because only a limited range of characters are allowed, the way in which the input is to be entered is unambiguous. This contributes toward making the system more user-friendly.
Here in our project , we are provided menu to the user which was discussed in last blog.
With the help of which user can perform the functionalities such as insert, delete,modify, search, grouping and order the books.



Here is code and output  of two functions of user in our program with different functionalities.User have the choice of the functionalities.
Among the two users Admin and student ,admin have access of all the functionalities while it is not the case for student.

CODE
 void administration()
   {
      cout<<"\n\nWelcome Admin";
      int choice;
      char ch;
      while(1)
      {
         cout<<"\nWhich operation you want to perform";
         cout<<"\n1.Insertion\n2.Deletion\n3.Modify\n4.searching\n5.Grouping\n6.orderby\n7.display \n\nEnter your choice ";
         cin>>choice;
          switch(choice)
             {
                case 1:
                   insertion();
                   break;
                case 2:
                    deletion();
                    break;
                case 3:
                    modify();
                    break;
                case 4:
                    searching();
                    break;
                case 5:
                    groupby();
                    break;

                case 6:
                    orderby();
                    break;

                case 7:
                    display();
                    break;
             }
           cout<<"\n\n"<<"IF you want to revisit the menu press y/Y else n/N to terminate the session ";
           cin>>ch;
           if(ch=='n'|| ch=='N')
              exit(1);
      }
   }
void student()
  {
      cout<<"\n\nWelcome Student";
      int choice;
      char ch;
      while(1)
      {
         cout<<"\nWhich operation you want to perform";
         cout<<"\n\n1.searching\n2.Grouping\n3.orderby\n4.display \n\nEnter your choice ";
         cin>>choice;
          switch(choice)
             {
                case 1:
                    searching();
                    break;
                case 2:
                    groupby();
                    break;

                case 3:
                    orderby();
                    break;

                case 4:
                    display();
                    break;
             }


Comments

Post a Comment

Popular posts from this blog

SEARCHING

ORDER BY PART-2

GROUP BY