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
The software or script to scan automotive ads Project Description: Looking for a company that made the script or application to search through pages of listings of automotive

Errors: When a dynamic linking failure or some other "hard" failure in the virtual machine happens, the virtual machine gives an Error. Typical Java programs could not find Error

can you explain me the er diagram for the online doctor system

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of the

Can you help? this assignment I will need to build a very straightforward and fully functional machine learning classifier with the K-Nearest Neighbor (KNN) algorithm. The KNN mode

My name is Myers, the project director of an online business that is scheduled to commence this summer in Nigeria. We are in the process of recruiting members to the project team a

1. Make a class Rational to provide at least following methos and constructors: Rational r1= new Rational (3,5); Rational r2= new Rational (4,7); Rational r3=r1.add(r2);

Explain the Member Access Separator ? class Car { String licensePlate; // e.g. "New York 543 A23" double speed; // in kilometers per hour double maxSpeed; // in

What is the role of hub in networks? The network traffic controller - elements of convential computer networks. Hub is used to link the different computers within the network i

What Content Issues is happened in java language? Some people claim in which Java is insecure since it can show the user erotic pictures and play flatulent noises. By this stan