Create a menu-driven program that accept collection integers

Assignment Help JAVA Programming
Reference no: EM131396033

Java Assignment

Java

Array Sorting, Traversal and Exception Handling

Create a menu-driven program that will accept a collection of non-negative integers from the keyboard, calculate the mean and median values and display those values on the screen.

Your menu should have 6 options:

1. Add a number to the array
2. Display the mean
3. Display the median
4. Print the array to the screen
5. Print the array in reverse order
6. Quit

Program particulars:

Use an array of type int to store the integers entered by the user. There must be error checking on the input integer. If it is negative, the program will print an error message and re-prompt. This process will continue until a non-negative integer is entered. You must use a try-catch structure to trap both types of input errors (like letters where numbers should go) and range errors (like -1).

You must write your own selectionSort utility method to sort your array. Place the method in an external file named SortSearchUtil.java.

There must be error checking on the menu choice entered. If the user enters a choice not on the menu, the program will print an error message, re-display the menu and re-prompt. This process will continue until a valid option value is entered.

Your solution must be modular. The design of your methods is up to you, but the rules of "highly cohesive" and "loosely coupled" must be followed.

Your program should be well-documented. Explain what you're doing in your code. Be sure to include the usual name and assignment notes.
Note your program will have to sort your array before you can find the median. Include your SortSearchUtil.java file which will contain your sort method.

Reference no: EM131396033

Questions Cloud

What are the advantages of complex routing algorithms : Complex routing algorithms are used to maintain routing tables. What algorithms are used, and how do they work? What are the advantages and disadvantages of each? Which ones are most commonly used in today's networks?
Present the problem that needs to be addressed : Provide a concluding paragraph that summarizes the stated problems and promises a solution - Develop a coherently structured paper with an introduction, body, and conclusion.
Create a menu-driven program that accept collection integers : Create a menu-driven program that will accept a collection of non-negative integers from the keyboard, calculate the mean and median values and display those values on the screen.
Analyze data with a mann whitney test : Grackles, commonly referred to as blackbirds, are hosts for a parasitic worm that lives in the tissue around the brain.- Analyze the data with a Mann-Whitney test and write a conclusion.
Create a menu-driven program that accept collection integers : Create a menu-driven program that will accept a collection of non-negative integers from the keyboard, calculate the mean and median values and display those values on the screen.
Have you ever been victimized by a computer error : For example, were you ever incorrectly denied credit, billed for something you did not purchase, or assigned an incorrect grade in a course? How did you resolve the problem? On the Web, find the most outrageous story you can involving a computer e..
Create a short story using the information : Create a short story using the information below. Apprx. 2/3 and 1 page in length. (Single spaced - with a space between multiple paragraphs)
Discuss block quote production is everything : 1) Many economists will argue that government should not be allowed or counted on to create jobs. Discuss your analysis of this type of action sometimes governments take. 2) Discuss Block's quote "Production is everything, and jobs are nothing but..
Explain all variables and methods are named appropriately : Explain All variables and methods are named appropriately. Student will make the second of three parts of a project that will form a tile editor application. In this part, the map and tile selector will be integrated.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write down a java program that implements a stack of

write a java program which implements a stack of integers. an integer should only be pushed into the stack if it is

  Implement a thread for each creature representing a task

Implement a threads and a GUI interface using advanced Java Swing classes.

  Create your own unique while-end repetition structure

Create your own unique While-End repetition structure. You decide the theme. You should provide both the pseudocode and the flowchart of your example.

  Define method headers for computeaveragesales

Define method headers for computeAverageSales() and computeShipping Charges() according to the following requirements. Develop pseudocode for two new methods to be added to your product class

  Design programs that communicate with web servers

Design programs that communicate with Web servers and server-side applications through the Hypertext Transfer Protocol (HTTP). Design Java programs that use the Structured Query Language to query and update relational databases. Describe the Java Ser..

  Create a class diagram that shows an interface

Create a class diagram that shows an interface called Buyer in the Violet UML editor. This interface should declare the methods to perform a buyer's responsibilities

  Translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For case, the number 2.8 which might have been the average of several grades would be converted to B-

  Create a class named blooddata

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor

  Create a table that depicts the runtime for arrays

Create a table that depicts the runtime for arrays of length 1 to 10. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain

  Frequently used java array method

Frequently used java array method -method name and parameter

  Allows a user to select a favorite basketball team

Write an application that allows a user to select a favorite basketball team from a list box. Include at least five teams in the list, and display the chosen team in a text field after the user makes a selection. Save the file as JBasketball.java. :

  Palindrome by doing character replacement

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement.

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