GetACoder.com

 
 

Home | My Account | Post Job | Browse Jobs | RSS Feeds | Careers New!

 

Java Programming

 
 
     
Job Summary:
 
Job Type: Project
Budget: $ 20-100
Required Skills: Programming
Attached Files: java.zip
 
Status: Work Performed (selected user TechnoVilla)
 
Buyer Summary:
 
Username:
atharkhan786  
Feedback Score: 10.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/10 2 reviews
Award Reliability: 2 posted 2 paid
 
Location: Sydney, Nsw, Australia
Member Since: May 28, 2008
 
Invited Users: There are no invited users


Description
Task 1
Create a class called Person. This class has four fields:
• firstName – a String modeling a person’s first name
• lastName – a String modeling a person’s last name
• town – a String modeling a person’s town of residence
• age – an int variable modeling a person’s age

The Person class should have appropriate get and set methods. It should also have at least two constructors – one with no arguments and one with four arguments.

Create another class called TestAssign2. This class should have 3 Vector fields called first, last and towns. These fields should be instantiated in the class’s constructor. They should have appropriate get and set methods associated with them.


Task 2

There are four input files associated with this application:
• firstNamesBoys.txt – contains first names for boys
• firstNamesGirls.txt – contains first names for girls
• lastNames.txt - contains last names
• namesVicTowns.txt. – contains names of some Victorian towns

Each of these input files contains one word per line. Hence firstNamesBoys.txt will contain one boy’s name per line. These input files will be used to create random input files for your application.

Write a public method in TestAssign2 called readInputFiles. This method does the following:
• It opens and reads firstNamesBoys.txt. Each name should be read into a string and added to the Vector called first.
• It opens and reads firstNamesGirls.txt. Each name should also be read into a string and added to the Vector called first.
• It opens and reads lastNames.txt. Each last name should be read into a string and added to the Vector called last.
• It opens and reads namesVicTowns.txt. Each name should be read into a string and added to the Vector called towns.


Task 3

Write a public method in TestAssign2 called createPersonFile(person,size). This method will create a file which consists of a number of lines each containing four fields:
• The first field is the first name of a Person
• The second field is the last name of a Person
• The third field is the town of residence of a Person
• The fourth field is the age of the Person

The method has two parameters. The first is a String indicating the output file into which the records will be read (eg “Person”). The second is an int which indicates the number of records to be created in the new file (eg 50). You will need to create an output file. The name of this file should consist of the input name followed by the number of records followed by “.dat” and should be placed in the root of the C: drive. Thus with the above example, the output file should be “c:\\Person50.dat”.

Use the Random class provided by the SDK to create random records in the output file. For each line, choose a random String from the Vector called first, a random String from the Vector called last and a random String from the Vector called towns. Also create a random int between 0 and 100 which will be used for the Person’s age. The four randomly chosen data elements should be written in the correct order to a single line of the output file. The number of records (lines) created is determined by the method’s second parameter.

Task 4
Create an interface to define Linked List classes. It should be called LinkedListInt and should define all the methods necessary to create a linked list of objects of type T.

Further to this add two overloaded methods called printList:
• One is a void method that takes no parameters.
• One is a void method that takes a BufferedWriter parameter

Task 5

Create a class called LinkedList which implements LinkedListInt. The linked list should be implemented in using a dynamic structure – ie not implemented using arrays or Vectors.

The printList method which takes no arguments should print out the last names of each element in the LinkedList. This output should go to standard output.

The printList method which takes the BufferedWriter parameter should be sent to the file indicated by this BufferedWriter object.

Both printList methods should neatly print out last names 5 to each line.

Task 6
Create a class called Hash which implements a chained hashing structure with linked lists as home buckets. The chained hash table should be implemented using an array of 30 LinkedList objects. You will need to use the LinkedList class you created in Task 5.
Write a private method called hash which takes a String as a parameter. This method should return an int between 0 and 29 (inclusive). This value is calculated by adding the ASCII values of each character in the String and then using the modulus operator (%).

Write a public method called insert. This method takes a Person object as a parameter. A hash value should be obtained by passing the Person’s last name to the hash method that you have just written. If the LinkedList object at the array position, indicated by the value returned by the hash method, is null then instantiate it. Add the Person object to the end of this LinkedList object.

Write a public method called retrieve. This method takes a String object corresponding to the Person’s last name as a parameter. The method should return a value of type Object. This Object should be the Person object associated with the last name passed in. The method should return null if the object is not found.

Write a public method called printTable. This method takes a BufferedWriter parameter indicating the file where the output should be sent to. The method should print out the last names of each of the objects in the LinkedLists of the hashTable. Ensure that each list is appropriately titled. All output should be sent to the file indicated by the BufferedWriter object.


Task 7

Write a public method in TestAssign2 called testHashing. This method is designed to test the efficiency of the hash table implementation. This method should do the following:

• Create an input file of 500 Person objects
• Place these objects into a hash Table
• Create a BufferedWriter object based on an output with the following name:
o “hash” + 500 + “.out”.
o This file should be located in the root of your project
• Use the printTable method to output the hashTable to the above file
• Choose a lastName (at random) from the Vector called last. Indicate whether this name is contained in the hash table. Send the output (appropriately set out) to the above hash table output file




Reminder
You may not start working in this and any request before your bid is accepted. Users who violate this policy may have their accounts permanently suspended.



 Bids Received (4)   Shortlist (0)   Declined Bids (0)   
Average bid amount:   $123.75   Average delivery time:   9 Day(s)
Place Bid | Post Similar Job | Send Request | Contact atharkhan786

Order by:

 

Remember that contacting the other party outside the site (by email, phone, etc.) on all business jobs (before the request is awarded) is a violation of our terms of use. We supervise all site activity for such infringements and can immediately expel transgressors on the spot, so we thank you in advance for your cooperation. If you notice a violation please help out the site and report it. Thank you for your help.
 

 
send private message
 
TechnoVilla  
Dhaka, BD
location
US$70
bid amount

9.97/109.97/109.97/109.97/109.97/109.97/109.97/109.97/109.97/109.97/10
(206 reviews)

feedback
3 day(s)
delivery time

 
 
Please check PM
Bid Time: 05-29-2008 22:47
 
send private message
Shortlist
Decline Bid
paradoxonline  
Nugegoda, LK
location
US$150
bid amount

9.47/109.47/109.47/109.47/109.47/109.47/109.47/109.47/109.47/109.47/10
(87 reviews)

feedback
5 day(s)
delivery time

 
 
Hi, we can do this.
Bid Time: 05-29-2008 21:05
 
send private message
Shortlist
Decline Bid
aanvik  
Atlanta, US
location
US$125
bid amount

9.75/109.75/109.75/109.75/109.75/109.75/109.75/109.75/109.75/109.75/10
(48 reviews)

feedback
5 day(s)
delivery time

 
 
Please see PMB. Thx -Aanvik
Bid Time: 05-29-2008 21:44
 
send private message
Shortlist
Decline Bid
shashikhan  
nagpur, IN
location
US$150
bid amount

10.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/1010.00/10
(2 reviews)

feedback
20 day(s)
delivery time

 
 
This can be done
Bid Time: 05-29-2008 21:18
 
 


 
Get the Free Step-by-Step Guide on How to Use GetACoder
The act of outsourcing jobs has become easy in the past few years thanks to GetACoder. However, our team aims at making the whole process even easier. So, it has now come the time to provide you with a step-by-step guidance on how to use this service and succeed in the outsourcing world totally for FREE.

It doesn't matter if you are a more experienced user or a novice; using GetACoder will become even simpler with the help of this E-book. There are two major sections: a Buyers section and a Coders section.

Buyers will learn:
  • How to outsource safely
  • How to pick the best freelancers
  • How to manage time and money

Coders will learn:

  • How to get the best jobs
  • How to secure their payments
  • How to build a long-lasting relationship with buyers

    ...and MUCH MORE
Clear examples and pictures illustrating key situations, great tips and real testimonies of some of our best users... all in this Outsourcing Guide.  So don't loose the outstanding opportunity to download GetACoder FREE E-book.
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
The Outsourcing Revolution: Why It Makes Sense and How to Do It Right
What is GetACoder?

GetACoder.comGetACoder is a leading Global Services Marketplace doing business in more than 200 countries. Our unique system accelerates your time to market and provides your business with key competitive advantages. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage. GetACoder makes outsourcing to any part of the world an easy task! With GetACoder it's simple to outsource any business request, gain access to global talent and manage jobs online.

One of the main advantages of GetACoder is the low labor cost. The typically rates are about seven times lower than the ones in the US or Europe. Posting a request at GetACoder allows the right professional or company to find you and to bid for your work. We are building a reputation for exceeding our customers' expectations and for becoming an extremely cost effective way to outsource work. Use GetACoder when you want to save money, increase efficiency or accelerate the development of your request. With GetACoder you focus on growing your business and let others do the tedious work. Post your request on GetACoder for free. Find out why people outsource jobs with us day after day.

Thousands of Satisfied Customers - Submit/View Quotes


-New way to show our skills! - raviact
-This is the best website I have ever seen. I have been a freelancer from the past 7 years and have worked on several sites. Within 1 minute after signing up and bidding, I got many responses, which shows how much positive this website is. Good Luck to you all! - samwipro
-This Site making IT very easy, every one can get what he need in most IT area, and in suitable time and budget. I am sure that most of members get maximum benefits from this site, and what getacoder.com provide is very hard to get in some where else . - alnadabi
Report Violation    Privacy Policy     Affiliate Program    Terms of Use    Contact Us    Help      GetACoder.com on Facebook      Follow GetACoder on Twitter      GetACoder.com Latest Requests RSS Feed
© 2004-2012 GetACoder. All rights reserved.