Write a java application that allows a user to enter numbers

Assignment Help JAVA Programming
Reference no: EM13772144

Homework 3 -

Write a Java application that allows a user to enter numbers into an array and then process them.

Enter the number of elements and the value of each element;

Your application will process the data entered and will display the results:

1. Display the elements of the array, max 10 per line

2. Find and display the max value and the index of this max;

3. Display the Even elements;

4. Sorts and displays the numbers from lowest to highest using Arrays.sort() method from java.util.Arrays class

It is recommended to design and implement the methods:

getMax - find the maximum element of the array;

getIndexOfMax - find the index of the maximum element (first if the are many);

displayEvens - find and display the even elements;

displayArray - display the elements of the array;

Example:

How many values you want to input:15

Enter number 0 :21
Enter number 1 :22
Enter number 2 :23
Enter number 3 :24
Enter number 4 :25
Enter number 5 :26
Enter number 6 :27
Enter number 7 :1
Enter number 8 :2
Enter number 9 :3
Enter number 10 :4
Enter number 11 :5
Enter number 12 :6
Enter number 13 :7
Enter number 14 :8

array:

21, 22, 23, 24, 25, 26, 27, 1, 2, 3,

4, 5, 6, 7, 8

Max value entered was 27 and has the index: 6

Evens entered:

22, 24, 26, 2, 4, 6, 8

Ascending Sorted Array is:

1, 2, 3, 4, 5, 6, 7, 8, 21, 22,

23, 24, 25, 26, 27

Reference no: EM13772144

Questions Cloud

Discuss the impact on american culture : Consider the term "The Greying of America." Define the term and discuss the impact on American culture. Then, look at how an older population will impact the United States, based upon your research, in the near future.
Write a review of jackies debut a unique day by mike royko : Write a review of Jackie's Debut a Unique Day By Mike Royko.
Sociological perspectives approach the subject of aging : Please don't send handshake if you have no knowledge of this subject and cannot answer as such. How does each of the sociological perspectives approach the subject of aging? Explain.
Prepare and submit a joint driveway easement : Prepare and submit a joint driveway easement that would cover their rights to use the joint driveway, which includes the following information within the agreement itself: Grantor, Grantee, Date
Write a java application that allows a user to enter numbers : Write a Java application that allows a user to enter numbers into an array and then process them. Enter the number of elements and the value of each element
Various sources of nutritional assistance : Choose a state and identify the various sources of nutritional assistance, including federal food aid, state aid, school lunch programs, food banks, etc. Determine the amount of aid that would be available to your family. Assume minimal income and..
How do family traditions contribute to individuals identity : How do family traditions and cultural legacies contribute to and/or inhibit an individual's self-identity?
Explain how the gel is made : What is the purpose of using an electrical current in this procedure, what are the five basic steps to running a gel and explain how the gel is made.
How was the status determined : In the case you selected, was the subject tried as an adult or as a juvenile? How was the status determined? Do you agree with this decision? Why, or why not

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create javascript program to find gross pay for employees

Create JavaScript program which will find out the gross pay for each of three employees. Company pays "straight time" for first 40 hours worked by each employee and pays "time and a half".

  Create a class called numberset

You need to create a class called NumberSet.  It needs an empty default constructor and an overloaded constructor that takes an integer argument and creates a vector with that many random numbers in it.  So... if I created

  Anbsp build a student record managing system application by

a.nbsp build a student record managing system application by doing the following1.nbsp create a student inheritance

  Write a java that reads from the user annual income

Write a Java program (name it IncomeTax) that reads from the user annual income as  integer value.

  Create a website

The preplanning design consists of a document that defines the element specifically requested by the client and indicates where these features will be located on the Website

  Write an if statement that uses the flag as the condition

Write an if statement that uses the flag as the condition. Remember that the flag is a Boolean variable, therefore is true or false. It does not have to be compared to anything.

  Create a japplet that contains a jlabel and jbutton

Create a JApplet that contains a JLabel and JButton -  create an HTML document to host the applet, set the Width to 450 and the Height to 200. Save as TestJChangeFont.html.

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

  Javas drawing capabilities

This week, we will be learning to use some of Java's drawing capabilities. The Graphics class provides methods for drawing many different shapes, using different colors, and for drawing strings using different fonts.

  Write a server for multiple clients

Write a server for multiple clients. The client sends loan information (annual interest rate, number of years, and loan amount) to the server. The server computes monthly payment and total payment and sends them back to the client.

  Artificial intelligence and computational linguistics

Artificial intelligence and computational linguistics - Andy Warhol Paintings - Write your answer to this problem on the next page, and feel free to tear out this page as a reference. Just for fim, here's the output of the method given as input a p..

  Program that prompts the user to enter the year and display

Write a program that prompts the user to enter the the year and first day of the year and displays the calendar table for the year on the console. For example , if the user entered the year 2013, and 2 for tuesday, January 1, 2013, your program shoul..

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