RandomWalker entire JAVA assignment | Programming Concepts and Methodology Lab 4
Other Programming Concepts and Methodology labs:
https://youtube.com/playlist?list=PLZPy7sbFuWVj3JfA4bY-1lOaJ1_cFp8S-
Lab description:
Write a class named RandomWalker following the good programming practices seen in class (test, document, conventional formatting, etc). I will give you a main program that creates and manipulates RandomWalkerobjects, but it won't work correctly unless you have written RandomWalker.
A RandomWalker object should keep track of its (x, y) location. All walkers should start at the coordinates (0, 0) when created. When a walker is asked to move, it should randomly move exactly one unit either left, right, up or down (ie, adds +/- 1 to either its x or y value, but not both). Each of these four possible moves should occur with equal probability. When done repeatedly, the resulting behavior is known as a "random walk". (See an example at http://upload.wikimedia.org/wikipedia/commons/f/f3/Random_walk_2500_animated.svg)
Each RandomWalker object should have the following public methods. You may add whatever private fields or methods you feel are necessary to implement these methods:
move() : Instructs this random walker to update its coordinates by randomly making one of the 4 possible moves (up, down, left, or right).
getX() : Returns this random walker's current x-coordinate.
getY() : Returns this random walker's current y-coordinate.
getSteps() : Returns the number of steps this random walker has taken (ie, the number of time move was called).
[1:52 PM]
You don't write any loops in your RandomWalker code. The program I give you will call your methods repeatedly to get its walk done.
Random walks have interesting mathematical properties. For example, given infinitely many steps, a random walker approaches 100% chance of reaching any particular (x, y) coordinate. To learn more about random walks, visit http://mathworld.wolfram.com/RandomWalk.html .
To complete the lab do the following:
Write each method.
Write brief javadoc documentation for each public method and for the class as a whole.
Write a main program in a class java that exercises all of the methods in RandomWalker and demonstrates that they are working.
Once you've done 1, 2 and 3, copy the following files into the same directory as your RandomWalker.java and run TestRandomWalker.java. You should see a random walk!
TestRandomWalker.java and Drawing Panel.java
I'll want to verify that:
~ You wrote a Main.java for testing RandomWalker.
~ Your code looks correct and well formatted.
~ You have written javadoc for all public members of RandomWalker and it compiles without warning.
~ TestRandomWalker runs correctly.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «RandomWalker entire JAVA assignment | Programming Concepts and Methodology Lab 4», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.