Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the entity class here is the example for output write in java please need it asap zoom in to 150 percent if the

image text in transcribedimage text in transcribed

Here is the entity class

image text in transcribed

image text in transcribed

here is the example for output

image text in transcribed

write in java please need it asap

zoom in to 150 percent if the picture is blur

more what?

Link to assignment description -11| Features of class World Declares a 2D 5x5 "array of Entities". Each element refers to an Entity object. (Worth 0.1 GPA) Defines a constructor which initializes each array element to 'null'. The element at [1][1] will refer to an Entity object (the starting location of the one entity in the simulation). (Worth 0.3 GPA, 0.2 initializing the entire array, 0.1 for specifying the correct starting location of the Entity) . Using nested loops the simulated world will be displayed. The appearance of an array element depends upon whether it is empty (space character) or the one element that refers to an Entity object (an x appears in the starting code for program but if the appearance is changed to another character (e.g. E then your program should display an 'E' and no an 'X'). That is, the display of the Entity is based on the current value of the appearance attribute. (Worth 0.4 GPA, 0.2 GPA for each case) Each element is bound above, below, left and right by a line (see Figure 1). (Worth 1.2 GPA if every element bounded in the 4 directions). Cases where every cell is bounded except for the following: Misses one of the following: top row, bottom row, left row, right row. (Worth 1.0 GPA) Misses two of the following: top row, bottom row, left row, right row. (Worth 0.8 GPA) Misses three of the following: top row, bottom row, left row, right row. (Worth 0.6 GPA) Misses all of the following: top row, bottom row, left row, right row. (Worth 0.4 GPA) Cases where only the outer boundary is bounded: o Only the very top AND the bottom is bounded: Worth 0.2 GPA) Only the very top OR the bottom is bounded: Worth 0.1 GPA) Figure 1: The display of array elements bounded in the four directions (starting location of object at [1][1]) Loop the display of the world until the user enters a negative location for the row or column (next feature). (Worth 0.1 GPA) (1) Prompts the user for the destination (row/column) to move the entity. (2) A negative value for either coordinate will end the program (regardless of what value was entered for the other coordinate e.g., (-1/-1),(-1,0), (20,-22) will all end the program). (3) A value outside the bounds of the array will result in an appropriate error message, non-negative out-of-bound values will still allow the program to prompt again as long as the other coordinate is not negative. (Worth 0.6 GPA, 0.2 GPA for each feature) Destination row (0-5): -1 Destination column (0-5): 0 Row/column: -1/0 outside world End simulation Figure 2: Any out-of-bound destinations will result in an error message. Any negative coordinates will end the simulation program. (The previous feature must be implemented first). Assuming that no out-of-bound coordinates have been entered, the program "moves" the entity to the specified destination. The previous cell will appear 'empty' (space) whereas the destination will take on the appearance of the entity ('X' in the starting code). Movement must work for multiple turns in order to get credit (and not just 'apparently' work for one turn and thereafter producing an incorrect result). (Worth 1.3 GPA, 0.7 GPA for properly setting the destination cell, 0.6 GPA for properly setting the source cell) To help you see the operation of the various features there is a sample output file in the assignment directory: (output.txt] Important points to keep in mind: Link to assignment description public class Entity { public static final char DEFAULT = 'X': private char appearance; public Entity setAppearance (DEFAULT): public Entity (char newAppearance) { setAppearance (newAppearance): public char get Appearance return (appearance); nrivate void setAnnearance(char newAnnearance) Link to assignment description Pay . public Entity { set Appearance (DEFAULT): public Entity(char newAppearance) { setAppearance (newAppearance); } public char getAppearance return (appearance); } private void setAppearance (char newAppearance) appearance = newAppearance: } } Link to assignment description Script started on Wed 02 Sep 2015 06:24:21 PM MDT [csc mini a3 101 ]> java Driver Destination row (0-5): -1 Destination column (0-5): -4 Row/column: -1/-4 outside world End simulation [csc mini-a3 102 ]> java Driver Destination row (0-5): -1 Destination column (0-5): 2 Row/column: 1/2 outside world End simulation csc mini-a3 103 ]> java Driver Link to assignment description -11| Features of class World Declares a 2D 5x5 "array of Entities". Each element refers to an Entity object. (Worth 0.1 GPA) Defines a constructor which initializes each array element to 'null'. The element at [1][1] will refer to an Entity object (the starting location of the one entity in the simulation). (Worth 0.3 GPA, 0.2 initializing the entire array, 0.1 for specifying the correct starting location of the Entity) . Using nested loops the simulated world will be displayed. The appearance of an array element depends upon whether it is empty (space character) or the one element that refers to an Entity object (an x appears in the starting code for program but if the appearance is changed to another character (e.g. E then your program should display an 'E' and no an 'X'). That is, the display of the Entity is based on the current value of the appearance attribute. (Worth 0.4 GPA, 0.2 GPA for each case) Each element is bound above, below, left and right by a line (see Figure 1). (Worth 1.2 GPA if every element bounded in the 4 directions). Cases where every cell is bounded except for the following: Misses one of the following: top row, bottom row, left row, right row. (Worth 1.0 GPA) Misses two of the following: top row, bottom row, left row, right row. (Worth 0.8 GPA) Misses three of the following: top row, bottom row, left row, right row. (Worth 0.6 GPA) Misses all of the following: top row, bottom row, left row, right row. (Worth 0.4 GPA) Cases where only the outer boundary is bounded: o Only the very top AND the bottom is bounded: Worth 0.2 GPA) Only the very top OR the bottom is bounded: Worth 0.1 GPA) Figure 1: The display of array elements bounded in the four directions (starting location of object at [1][1]) Loop the display of the world until the user enters a negative location for the row or column (next feature). (Worth 0.1 GPA) (1) Prompts the user for the destination (row/column) to move the entity. (2) A negative value for either coordinate will end the program (regardless of what value was entered for the other coordinate e.g., (-1/-1),(-1,0), (20,-22) will all end the program). (3) A value outside the bounds of the array will result in an appropriate error message, non-negative out-of-bound values will still allow the program to prompt again as long as the other coordinate is not negative. (Worth 0.6 GPA, 0.2 GPA for each feature) Destination row (0-5): -1 Destination column (0-5): 0 Row/column: -1/0 outside world End simulation Figure 2: Any out-of-bound destinations will result in an error message. Any negative coordinates will end the simulation program. (The previous feature must be implemented first). Assuming that no out-of-bound coordinates have been entered, the program "moves" the entity to the specified destination. The previous cell will appear 'empty' (space) whereas the destination will take on the appearance of the entity ('X' in the starting code). Movement must work for multiple turns in order to get credit (and not just 'apparently' work for one turn and thereafter producing an incorrect result). (Worth 1.3 GPA, 0.7 GPA for properly setting the destination cell, 0.6 GPA for properly setting the source cell) To help you see the operation of the various features there is a sample output file in the assignment directory: (output.txt] Important points to keep in mind: Link to assignment description public class Entity { public static final char DEFAULT = 'X': private char appearance; public Entity setAppearance (DEFAULT): public Entity (char newAppearance) { setAppearance (newAppearance): public char get Appearance return (appearance); nrivate void setAnnearance(char newAnnearance) Link to assignment description Pay . public Entity { set Appearance (DEFAULT): public Entity(char newAppearance) { setAppearance (newAppearance); } public char getAppearance return (appearance); } private void setAppearance (char newAppearance) appearance = newAppearance: } } Link to assignment description Script started on Wed 02 Sep 2015 06:24:21 PM MDT [csc mini a3 101 ]> java Driver Destination row (0-5): -1 Destination column (0-5): -4 Row/column: -1/-4 outside world End simulation [csc mini-a3 102 ]> java Driver Destination row (0-5): -1 Destination column (0-5): 2 Row/column: 1/2 outside world End simulation csc mini-a3 103 ]> java Driver

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago