Page 631 - Computer science 868 Class 12
P. 631

25      if(front!= rear)
                   26      {

                   27      front = (front+1)%n;
                   28      return q[front];
                   29      }

                   30      else

                   31      return - 9999;
                   32      }
                   33

                   34      void display()
                   35      {

                   36      if(front!= rear)
                   37      {

                   38      for(int i=(front+1)%n; i!=rear;i=(i+1)%n)
                   39      {

                   40      System.out.println(q[i]+"");
                   41              }

                   42          }
                   43      }

                   44
                   45      public static void main()

                   46      {
                   47      Scanner sc = new Scanner(System.in);

                   48      circularQob = new circularQ(5);
                   49      int ch,a;

                   50      do
                   51      {

                   52      System.out.println("Enter choice");
                   53      ch = sc.nextInt();
                   54      switch (ch)

                   55      {

                   56      case 1:
                   57      System.out.println("Enter marks");
                   58      a= sc.nextInt();





                                                                                                                       629
                                                                                                   Internal Assessment  629
   626   627   628   629   630   631   632   633   634   635   636