Design and implement a java program


Discuss the below:

Q: Design and implement a Java program which sorts a 10 element integer array using the bubble sort process. The elements of the array to be sorted should be supplied by the user (assume the user will not input duplicates).

Remember to write the source code for each class in a separate file which must have the same name as the class name together with the extension .java. Remember also that by convention, class names commence with a capital letter.

Create a GUI front end for your bubble sort program. The result should look something like that presented below: You may use any graphic element to create your display - JOptionPanes are the easiest and most basic tools available to you, but you may also experiment with additional GUI controls such as JFrames, JPanels, etc. I would advise you to use objects from the Swing library (those objects begin with 'J') as opposed to objects from the AWT library - Swing objects are a little easier to use and are ultimately more flexible and robust than AWT objects.

In the example below, there are 10 text fields on a JFrame background to allow input of array elements (remember that for each text field you must press the carriage return key to invoke the listener). When the array has been populated, we press the start button, at which point the given array is output as a label. We then sort the result and output the sorted array.

Bubble sort GUI (partial example)

2130_Bubble sort.jpg

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design and implement a java program
Reference No:- TGS01935422

Now Priced at $25 (50% Discount)

Recommended (90%)

Rated (4.3/5)