Write a java client by using arraylists, JAVA Programming

1. The purpose of this problem is to practice using ArrayLists.Write a Java client file containing a mainmethod plus other methods as needed to solve the following problem (no class definition file is to be used).(remember to solve this problem by calling a number of methods, rather than writing large code segments)

  • Generate 30 random numbers between 1 and 1000 inclusive and store these in 2 different ArrayListssimultaneouslyas described below
    1. each ArrayList should be created using the default size (of 10)
    2. the first ArrayList should hold the random numbers in the order they are generated (so it will need to automatically expand to accommodate the data)
    3. the second ArrayList should hold the random numbers in sorted order. This will be accomplished by inserting each element as it is generated into the second ArrayList using a modified version of the insertion sort code we studied in class

a. make a method that contains your modified insertion sort code.  Your code should work with an ArrayList, not a Comparable[ ].

  • Display the 2 ArrayLists, hopefully demonstrating that your modified insertion sort works (note the first arraylist will display the unsorted data, while the 2ndarraylist should be sorted)
  • create another method that will perform a selection sort on an arraylist and send it the first (unsorted) arraylist. This method should contain a modified version of the selection sort code we discussed in class; the code is modified to use an arraylist rather than a comparable[ ].
Posted Date: 3/21/2013 2:13:25 AM | Location : United States







Related Discussions:- Write a java client by using arraylists, Assignment Help, Ask Question on Write a java client by using arraylists, Get Answer, Expert's Help, Write a java client by using arraylists Discussions

Write discussion on Write a java client by using arraylists
Your posts are moderated
Related Questions
State in brief about the java Java is a object-oriented, simple, distributed, robust, interpreted, architecture-neutral, secure, portable, multi-threaded, high- performance and

Relate java with JVM Java performance gets better each year as JVM gets smarter. This works, since making JVM smarter doesn't require any great change to the java language, sou

Describe about Applet Security? The possibility of surfing the Net, wandering across a random page, playing an applet and catching a virus is a fear in which has scared several

What is the use of throws keyword ? Rather than explicitly catching an exception you can declare in which your method throws the exception. This passes the repsonsibility to h

This assignment is based on the principles of clock consistency and associated drifts in a distributed system. You have to create a simulation, running on a single machine, of a si

Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to make beans on demand, such as a bean that encapsulates the business logic t

What is Invoking static methods If a method or field is declared static, you access it through using the class name rather than a reference to a particular example of the class

OOPS with Java 1. Explain any five buzz words in Java. 2. Explain exception classes and also explain common exceptions in java. 3. Explain primitive and abstract data typ

Project Description: I want to build a camera application for android. By default android will add metadata for the image, for e.g.  Date, time, resolution, gps tag etc..In this

Java Remote Method Invocation (RMI): It gives a way for a Java program on one machine to interact with objects residing in different JVMs. The important blocks of the RMI arc