Question: This is written in Java. Please follow all the instructions and make sure the program has all the components of the rubric. Rubric Terrain.Java: public

This is written in Java.

Please follow all the instructions and make sure the program has all the components of the rubric.

This is written in Java. Please follow all the instructions and makesure the program has all the components of the rubric. Rubric Terrain.Java:

Rubric

public class Terrain { // instance variables private int length, width; //Terrain.Java:

public class Terrain { // instance variables private int length, width; // Constructor for objects of class Terrain public Terrain(int l, int w) { // initialize instance variables length = l; width = w; } public String getTerrainSize() { return "Land has dimensions " + length + " X " + width; } }

Instructions: Create a class hierarchy of simple terrains that might be used in a graphical video game. Background: This project will give you a feel for how programmers create terrains in which to place characters within a graphical video game. The terrains will be very simplistic representations containing details specific to each. When creating a game, many terrains are often used. Instead of starting from scratch each time, a programmer can simply start with a previous one that closely matches it and build it up from there. This saves lots of time and allows developers to reuse their resources wisely. The key to completing this assignment is to carefully manage the relationships between the super classes and the subclasses. 1. Create a new project called 09.02 Assignment in your Module 09 Assignments folder. 2. Download the Terrain.java file to the new folder. 3. For this project, create each of the remaining classes for the hierarchy shown in the diagram. Terrain Mountain Forest Winter Mountain 4. A Mountain class has an attribute for the number of mountains. 5. A class WinterMountain has all the attributes of a mountain plus the temperature 6. A class Forest has an attribute for the number of trees. 7. Create a program to test your terrains. Name it GameTerrainTester in your assignment folder. Be sure to instantiate at least one instance of every terrain. When the program is run, each terrain and the values of its attributes need to be neatly displayed. 8. Add two more terrains to your project. Only one class can be direct subclass of Terrain. Each new class needs an attribute that is unique to its terrain. Expected Output: Your output should look similar to the image below but may vary based on the values used. +Blue) X Options Land has dimensions 150 X 240 Forest Land has dimensions 400 X 400 and has 180 trees Mountain Land has dimensions 600 x 200 and has 12 mountains Winter Mountain Land has dimensions 500 X 500 and has 30 mountains and temperature 12.34 degrees 09.02 Class Hierarchies Grading Rubric Points Possible Points Earned Components Comments include name, date, and purpose of the program. 1 Classes correctly extended: Mountain, Winter Mountain, Forest and accessors/mutators correctly defined. 3 Constructors correctly defined and use super. 3 Two additional terrains included in the class hierarchy. 2 Tester program instantiates and displays an example of each terrain. 3 No compiler errors. No runtime errors. Output is accurate. 2

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!