Circular Queue with JOptionpane

Submitted by: 
Language: 
Visitors have accessed this post 8990 times.

IT COVER THE LOGICAL METHOD TO CREATE THE CIRCULAR QUEUE
IN THIS PROGRAM I CREATED A MENU THAT WILL HELP YOU TO SELECT THE OPTION IN THE QUEUE. THIS IS THE V 1.0 SO I NEED YOU COMMENT . IN THE PUSH OPTION THE DATA IS PUSHING INTO AN ARRAY AND IT POPPING FORM IT .

Author : Abhilash Joseph C
Date : 11th August, 2009
Email : [email protected]
Mob : 08050126851


Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

  1. import javax.swing.JOptionPane;
  2. import java.util.*;
  3. import java.util.Scanner;
  4.  
  5. public class ArraySize{
  6.  
  7. int size;
  8. int arr;
  9. Scanner input=new Scanner(System.in);
  10.  
  11. public static void main(String[] args){
  12.  
  13. ArraySize number=new ArraySize();
  14. number.showDialog();
  15. }
  16. public void showDialog(){
  17.  
  18. size=new Integer(JOptionPane.showInputDialog("Enter Array Size:"));
  19. size();
  20. }
  21. public void size(){
  22.  
  23. arr=size;
  24. int[] number=new int[arr];
  25. System.out.println("The size of array is "+arr);
  26. for(int index=0;index<arr;index++){
  27. System.out.print("Enter number: ");
  28. number[index]=input.nextInt();
  29. }
  30. System.out.print("The input value before sorting: ");
  31. for(int index=0;index<arr;index++){
  32. System.out.print(" "+number[index]);
  33. }
  34. System.out.println();
  35. System.out.print("After Sorting: ");
  36. Arrays.sort(number);
  37. for(int index=0;index<arr;index++){
  38.  
  39. System.out.print(" "+number[index]);
  40. }
  41. }
  42. }

Hello there, I have tried your circular queue with the JOptionPane and it is working. Great Job. But I noticed that if a user deletes and item from the queue using the delete option, and then if he/she checks to see if it was really removed by displaying the queue again, the removed item is still there? Can you pls tell me what code to put in the display or delete methods to have the display operation updated???? Thanks a lot!!!

Have a nice day and God bless.

Pres

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe>
  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.