CIS 180: Object-Oriented Programming

Programming Project #6

 

Sorting Algorithms

 

Due by Dec. 12th, 2003

 

Objectives

 

The objectives of this homework are:

 

To practice GUI based IO

To practice passing arrays as parameters.

To practice sorting algorithms and think about their efficiency

 

 

Problem Statement

 

Write a GUI-based application allowing the user to enter a set of integers and choose a sorting algorithm for sorting them. The application sorts the numbers from smallest to the largest using the algorithm selected by the user. The sorted numbers are displayed. In addition to sorting the numbers the application counts and displays the number of swaps for the selected algorithm, where a ÒswapÓ means switching two elements of an array.

 

HINT: Reuse some of the design and code from Homework #5 !

 

Constraints

 

Interface

 

Steps to take

 

 

What to turn in

 

When your assignment is complete, add some comments to the beginning of the java source code explaining any problems you encountered in completing the assignment and describing any bugs in your solution. Undocumented bugs are worse than documented bugs. If you have undocumented bugs we will assume that you did an inadequate job of testing your code, and you will lose additional points.

 

Prepare a report showing the data entered, algorithm, and swap count for all the tests. Provide the results of your analysis in form of your observations, conclusions and possibly some suggestions of other tests that may prove your point. Course instructor will provide you with information how to submit this portion of your homework.

 

To submit your homework, follow the link from the homework page to the homework submission form.

 

There will be a 10% penalty for assignments received after the due date. Assignments will not be accepted more than one week past the due

date.