Create a java program with input from the keyboard

Assignment Help JAVA Programming
Reference no: EM131272921

Sorting Algorithm Assignment

Part 1: The Selection Sort method repeatedly finds the smallest number in the current array and swaps it with the first number in the array.

Develop a pseudo-code algorithm that accomplishes this method. Include input to the method, and output from the method.

Create a Java program with input from the keyboard and output to the screen that executes this pseudo-code. Data validation standards are to be used for the input. Valid numbers are in the range of 1-1000. Invalid data should be sent to an error file with an appropriate error message.

Develop a reasonable set of 19 numbers from which to test the method. This test data should have at least one pair of numbers which are equal, two numbers that are negative, and two numbers that are higher than 1000.

Full documentation for the class and the methods is expected.

Part 2: The Bubble Sort algorithm makes several passes through the array. On each pass, successive neighboring pairs are compared. If a pair is in decreasing order, its values are swapped; otherwise, the values remain unchanged. The technique is called a bubble sort or sinking sort because the smaller values gradually "bubble" their way to the top and the larger values "sink" to the bottom.

Develop a pseudo-code algorithm that accomplishes this method. Include input to the method, and output from the method.

Create another Java program that replaces the Selection Sort with a Bubble Sort.

Test this program using the same data developed for the Selection Sort.

Document this program using class documentation standards.

Develop a new pseudo-code algorithm using an alternate loop program structure to accomplish this sort. You do not need to implement this algorithm.

Part 3: Add a counter to the inside of the nested loops in both sorts to count the number of execution of the comparison statement. Would you expect this value to be the same for both sorts? Execute both programs using the data files attached to this assignment and analyze the value of the counter for each sort. Explain your findings. If the counters are equal, what does this mean? If the counters differ, what does this mean? Based on these findings, what can you say about the two algorithms?

This assignment is an individual assignment. You are expected to do your own work in accordance with departmental Academic Honesty Guidelines. Submit the algorithm write-ups and the two compressed folder projects to Blackboard on or before the due date. Turn in the pseudo-code for each of the algorithms, source code, output of the programs, and write-ups to the instructor's office (not in his mailbox) no later than noon on Friday (5-1-2015).

Here is the following 19 numbers..

888
100
600
700
900
200
220
330
440
400
2600
-9000
0
17000
500
500
660
15
19

Reference no: EM131272921

Questions Cloud

Describe steps that you would use in order to convert table : Describe the steps that you would use in order to convert database tables to the First Normal Form, the Second Normal Form, and the Third Normal Form.
Explain the variety of motivational theories : Explain the variety of motivational theories and job design considerations. Analyze the relationship between basic organizational behavior models of individual, group, and organizational processes, and productivity of organization.
Major elements of the promotion mix : Refer to SME Ads Inc. As Steven plans to expand the company's focus to other major elements of the promotion mix, which of the following should he focus on if he wants to help his clients create and maintain favorable relationships between them an..
Major elements of the promotion mix : Refer to SME Ads Inc. As Steven plans to expand the company's focus to other major elements of the promotion mix, which of the following should he focus on if he wants to help his clients create and maintain favorable relationships between them an..
Create a java program with input from the keyboard : Create a Java program with input from the keyboard and output to the screen that executes this pseudo-code. Data validation standards are to be used for the input. Valid numbers are in the range of 1-1000.
Marketing research project proposal : How you will analyze the data collected by this survey. Write out explicit regression formulas. Describe how you will interpret the coefficients, which coefficients are important and will help you answer the research problem.
What is primary form of power you tend to use frequently : What is your primary form of power you tend to use most frequently? How is power different from politics? Provide an example of how you have used the different 5 forms of power or heard or seen someone else using them.
Create pseudo code for the given three stack methods : Assume a "Head" node exists with the NextRef attribute pointing to the first node in the stack or being null if the stack is empty. Create pseudo code for the following 3 stack methods, showing the logic tied to the inverted list.
How should we define fair compensation : How should we define "fair" compensation? What tests/procedures would you recommend to an organization to determine whether the ways in which they compensate employees is "fair"? Why

Reviews

Write a Review

JAVA Programming Questions & Answers

  If the number on two of the players'' four cards

If the number on two of the players' four cards is the same and the number on the remaining two cards is also the same yet the number on all four cards in not the same then the player gets their bet back and in addition wins 22 chips for each chip th..

  Aimthe problem and implementing the design using principles

aimthe problem and implementing the design using principles of correct syntax program structure and

  Write a program that prompts the user to enter a point

Write a program that prompts the user to enter a point (x,y) and checks whether the point is within the rectangle centered at (0,0) with width 10 and height 5

  Describe creating java programs to calculate the squares

Using a while loop, write the square of all integer numbers from 0 to 10 make the program calculate the squares

  Java program which, given three sides of a triangle

Produce a Java program which, given three sides of a triangle, determines whether the triangle is:

  Write a program to implement bubble sort and insertion sort

Write a program to implement bubble sort, insertion sort, selection sort, merge sort and quick sort (pivot = random index) algorithms

  Determine how much either joe or jim makes separately

What type of equation would you create to determine how much either Joe or Jim makes separately? What equation is needed in Java (ignoring the $ symbol)? What data type is needed need for this equation

  What is abstract class and how it differ from regular class

What is an abstract class and how does it differ from a regular class? Why are abstract class constructors defined as protected

  Create the look for two gui applications

Create the look for two GUI applications. You WILL NOT be getting the applications to do anything. We are only interested in seeing how well you can arrange the GUI components onto the window

  Plotting some pois on a graph

Several types of point of interests (POI) such as - (1) Petrol station, (2) Taxi Stand, (3) ATM, (4) Hospital and (5) Shopping centre are located in a city. Their locations (longitude and latitude) are provided in a text file (a file will be provided..

  Implements both the quicksort and mergesort algorithms

Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it ..

  Javascript validation - cgi program

CGI mailer script form-mail.pl to your server's cgi-bin directory, and change the permissions on the script to make it executable - BMIS 310

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd