Question: Please write the code for Frog.java and Snake.java. Must include comments. Universal JAVA Concept: interface means you are writing method with a specific name, in

Please write the code for Frog.java and Snake.java. Must include comments.

Please write the code for Frog.java and Snake.java. Must include comments. Universal

JAVA Concept: "interface" means you are writing method with a specific name,

in this case the getMove() method can be called thousands of times

to get an animal moving. Your coding here is really brief, trivial,

short (in retrospect) but the concepts are monumental. For now, just write

Frog and Snake, as they demonstrate well an understanding of how this

interface is working. This has been called "Critters" in the past, but

Universal JAVA Concept: "interface" means you are writing method with a specific name, in this case the getMove() method can be called thousands of times to get an animal moving. Your coding here is really brief, trivial, short (in retrospect) but the concepts are monumental. For now, just write Frog and Snake, as they demonstrate well an understanding of how this interface is working. This has been called "Critters" in the past, but now SIGNIFICANTLY (January 2023) changed, so work this Assignment, not the wrong one out there on a million other websites. To be an Animal as per the code interface specifications, you must: - provide .toString() and we're just using one character like "B" for Bird at this time - provide .getMove() to simulate the keypad, like 8 is up or NORTH, the 2 is down or SOUTH (see Animal.java) - provide .getColor() provides the standard Java Abstract Windows Toolkit (awt) Color. - data fields are optional, like Bird none are needed, but Mouse needs to recall position so I used a boolean data field (see Mouse.java) Your task is to build on above, for sure the Frog and Snake will need other data fields (Hint: I used private int count), to recall what each object is doing, and you probably will need to recall the Random stuff we did back in CS210. Start with a download all the files provided below, into a new project folder for this assignment (probably good to do this with every project), then rur which will also need: Notice that AnimalMain calls the getMove() a bunch of times for each Animal. Why are we doing this??? This is the fundamental concept of how animations work in graphics. You have a loop that calls to move a step over and over and over, thousands of times, just for a few seconds of video. Eventually, you can put these into an Animal Graphic User Interface (GUI) and if you were at U.W. a few years ago, you could experience an entire graphics Critters tournament. Let's not go there, this Assignment just gets us to understand the basic topic of how animation works!!! // The Animal interface defines the methods necessary for an animal // to participate in the animal scramble simulation. It must return a // character when getchar is called that is used for displaying it on // the screen. The getMove method must return a legal move (one of // the constants NORTH, SOUTH, EAST, WEST, CENTER). public interface Animal \{ // Each direction resolves to int // based on layout of keypad, 8 at top, 2 at bottom, etc.. public static final int NORTH =8; public static final int SOUTH =2; public static final int EAST =6; public static final int WEST =4; public static final int HOLD =0; // methods required by interface public String toString( ); public int getMove(); public Color getcolor (); You must also follow my general requirements from "Getting Started": 1. Program submission requirements 2. Class (data structure) Submission Requirements 3. Specifically, NO System calls in any of these submissions 4. The two animals you submit must meet the moving requirements on page 666 of text

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!