Write a main method that reads ten integer values

Assignment Help JAVA Programming
Reference no: EM132091536

Write a main method that reads 10 integer values from a file and stores them in an array called ages.

Write a new method called printArray that receives the ages array and prints the content of the array separated by commas (No comma at the beginning or end of the line).

File Sample: 5 7 18 30 5 78 8 22 6 90 Output Sample) Ages: 5,7,18,30,5,78,8,22,6,90 Part 2)

Write a method called Sort1 that will use the array ages.

This method will arrange all the ages in the array from youngest to oldest and return a new array called sortedAges.

Print new arranged values by calling the method printArray with parameter sortedArray. Output Sample)

Ages: 5,5,6,7,8,18,22,30, 78, 90 Part 3) In the main method, create a two dimensional array of length 5 rows by 5 columns with the values shown below. Write a method called print printArray2 to print the content of the array in matrix form. Output Sample) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Part 4).

Write a method called print printArray3 to print the content of the elements of the diagonal elements in the matrix above. This print method should work for any array of size n by n. Output Sample) 1 7 13 19 20 5 9 13 17 21

(Java Language)

Reference no: EM132091536

Questions Cloud

Implement a program that allows you to chat with people : Implement a program that allows you to chat with people over the network like the instant messaging.
Atmosphere larger in high latitudes or in the tropics : Is the direct effect of increasing CO2 on the energy output at the top of the atmosphere larger in high latitudes or in the tropics?
What are some practical applications : Why can water stay in bucket if you spin it upside down, if you spin the bucket fast enough? What are some practical applications of this?
Have to react before it hits the asteroid : How much time do the people on the ship have to react before it hits the asteroid?
Write a main method that reads ten integer values : Write a main method that reads 10 integer values from a file and stores them in an array called ages.
How do you make the connection in each case : What maximum and minimum capacitance can you form from these? How do you make the connection in each case?
What are the basic or fundamental physical quantities : What are the basic or fundamental physical quantities and why are they called that?
Investigate distributed database management system : Distributed database support in systems such as Cassandra, Clusterpoint, SQL Server, Oracle, FoundationDB, NuoDB, etc.
Cases of celery to the farmer : Sandra needs to deliver 20 cases of celery to the farmer's market directly east across the river, which is 32 km wide.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program that tests the users ability

CS 1400 - Hilton - Write a program that tests the users ability to memorize a random sequence of colors - you are required to write elegant code

  Write a blog article for a codingtechnical community

write a blog article for a codingtechnical community blog.the theme is general c or java. choose any subject under this

  Integer expression evaluator

You must implement a bounded generic Stack class. Represent your Stack using an array to hold the stack content - Integer Expression Evaluator

  How can i connect from an applet to a database on the server

1) How do I create an applet that accepts an unlimited number of parameters? 2) How can I connect from an applet to a database on the server?

  What are the advantages and disadvantages of ood

In OOD, an object combines data and operations on that data into a single unit, a feature called encapsulation. Discuss the following question with your classmates:What are the advantages and disadvantages of OOD?

  Java programming-days alive calculator

The context for this assignment (all parts) is a ‘Days Alive Calculator' - a small desktop applicationfor calculating the number of days someone has been alive based on the date of birth and a seconddate, which may be today's date or some other date.

  Write program in java to calculate interest

Write a program in java to do the following : the following data is stored for each customer in the bank: account number,average balance and number of transaction for each customer it is required to calculate the interest earn

  Visual display of internet data and information matters

Explain why the visual display of internet data and information matters? what makes the display effective? describe what you like about the design of websites and web resources. Find at least two examples of web content on the internet that you li..

  Create four classes that must all interact

You will create four classes that must all interact in some meaningful way. In order to start you will create a class diagram to determine which classes depend on other classes and what those classes are

  Create a java application that displays your name

In order to practice writing, compiling, and running Java, you decide to create a Java application that displays your name and address on the screen.

  Create application in java programming

Write method multiple that determines, for a pair of integers, whether the second integer is a multiple of the first.

  Explain why the given class hierarchy is not reasonable

Explain why the following class hierarchy is not reasonable. Given all the problems identified in problems 1 through 4, explain in detail why the following code works, ie, compiles without errors or warnings.

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