Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

Java program language

For this assignment, you will create several classes:

IMPORTANT NOTE: The following classes are different from the versions of these classes in the first version of this programeven though some share the same name as classes from that version.

Location class, that contains two private instance variables:

  • An int named row
  • An int named column

Add whatever methods you need to this class.

  • Wanderer
  • aCloseSeeker class

Both of these classes should implement an interface called MoverMover should require three public methods:

  • void update();
  • String toString();
  • intgetFoodChainPosition();

Wanderers and CloseSeekers should contain the following private instance variables:

  • intfoodChainPosition
  • MoverController theController

The foodChainPosition of a Wanderer should be set to 1. The foodChainPosition of a CloseSeeker should be set to 2.

  • When asked to update, a Wanderershould try to randomly move one space up, down, left, or right.
  • When asked to update, a CloseSeekershould do the following twice:
    • randomly move one space up, down, left, or right… unless there is a Wanderer in any square it can move to. In that case, it should move onto the
  • Wanderercan never move to the same space as a CloseSeeker.
  • Wanderershould not move if there is a CloseSeeker on its space.
  • CloseSeekershould not move if there is a Wanderer on its space.
  • CloseSeeker can never move to the same space as another CloseSeeker.
  • CloseSeeker can move into the Wanderer‘s space, and should when possible.
  • When toStringis called, Wanderers should return the string: “Wanderer at position (row, column)” and CloseSeekers should return the string “CloseSeeker at position (row, column)”

You will likely find it useful to declare additional methods.

Write another class called MoverController that has the following method:

  • ArrayList<Mover> checkLocation(Location location).

This method should return an ArrayList containing references to all the Movers at that location, if there are Movers at that location. It should return an empty ArrayList if there are no Movers present. When your Movers are asked to update, they should call this method on the controller and use the ArrayList it returns to determine how to move. It may be very useful to call the getFoodChainPosition method on the reference that checkLocation returns.

(why does this return a container? In the middle of a move there might be two Movers on the same space — a Wanderer, and a Seeker which just moved onto that Wanderer. When you check and see if a Wanderer can move, you only want to move if there’s no Seeker present — and if checkLocation simply returned one Mover, it might end up returning the Wanderer that itself called checkLocation.

 

IMPORTANT:  Here is the control flow for each update:

  1. MoverController calls update on each Moverone by one
  2. update calls checkLocationon MoverController
  3. update uses the results of the checkLocation call or calls to actually select what location to move to, calling getFoodChainPositionon the object returned by checkLocation as necessary.

MoverController should also have one container that contains 25 Movers: 20 Wanderers and 5 CloseSeekers.

In the final version of the program the locations of the Movers should be set randomly. However, for testing it may be useful to explicitly give positions of Wanderers and CloseSeekers, in order to verify that they move properly.

Each turn the MoverController should iterate over the container, sending the update() message to each Mover one by one.  After the MoverController sends an update message to each object, it should use toString() to print information about all objects.

If at the end of the turn a CloseSeeker and a Wanderer occupy the same row and column,  your controller should remove the Wanderer from its container and print the message “Wanderer found at (row, column) on turn [current turn].” When there are no remaining Wanderers in your program should print the message “All Wanderers found in [n] turns” and quit running. There is more than one way for your program to keep track of how many Wanderers are remaining.

Your main function should ask the user to enter a number of turns to run the simulation. If that number of turns passes without all Wanderers being found, print the message “final positions after [n] turns” and then the results of calling toString() on each remaining Mover.

When done, upload all of your classes.

 

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW


Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.