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

  Disadvantages to using data structures

How are data structures managed and organized in this language. How does the management or syntax of data structures in this language differ from how data structures are handled in other language.

  Write a method which reverses the order of items

Write a method static void reverse (List l) which reverses the order of items stored in the list. Again, make sure it works for any special cases you can think of - write a series of statements to create several AList and/or LList objects (of typ..

  Implement a custom environment for your maze game

ITECH7201 Software Engineering - Design and implement a custom environment for your maze game. This requires producing your own unique hand-drawn map of the maze game environment.

  Create a application that will present a survey to customers

You have been asked by your manager to create a user-friendly application that will present a survey to your customers. The application will compile and analyze the results entered by the survey respondents.

  Calculate and display the loan amount to two decimal places

Calculate and display the loan amount to 2 decimal places. Call all the calculation methods (methods 2 - 4) to compute the three parts of the monthly mortgage payment, and save the results returned from each.

  Recommend at least five factors which programmers must

propose at least five factors that programmers should consider when choosing between data types such as those used in c

  Create an array of size n and fill it

Sketch a high level design of what you want to implement using the UML notation. At the very least, you should have a use case diagram, class diagram and a sequence diagram.

  Calculates profits and sales prices for a furniture company

First calculate the profit, then calculate the sales price, then calculate the profit when the sale price used.

  Computing the time complexity using the big-o notation

You are required to calculate the time complexity using the big-O notation of the Algorithm_2 given by the following methods defined by the following Java code.

  Evaluate the average temperature for the month

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Evaluate the average temperature for the month and the count the number of days

  All your code should be in the main method

Write a Java test program, all your code should be in the main method, that asks the user for two numbers representing an investment value and interest rate

  Physical design and implementation

In this project you will perform the physical design and implementation using SQL Data Definition Language (DDL) and proceed with populating the Mom and Pop Johnson Video Store database via Data Manipulation Language (DML) SQL commands.

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