Design and implement a java program which sorts a 10


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 in Figure 1. 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.

Hint: Do not attempt to make the GUI too sophisticated. Just concentrate on producing a working result (although sound programming techniques should still be applied).

2184_pp.png

Figure 1: Bubble sort GUI (partial example)

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.

As with all programs I write, I should provide a well-structured solution that is easy to read. I should use meaningful identifier names and I should provide useful comments.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design and implement a java program which sorts a 10
Reference No:- TGS01251081

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)