Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Objectives

1. To help you become comfortable with using inheritance and interfaces to construct type hierarchies.

2. To familiarize you with programming from specifications.

As per usual practice, any input files will be placed in the same directory as your program during grading. (Don't forget how Eclipse/NetBeans handle these things if you use one of those IDEs.)
Problem: Adventurer Assistance, Inc.

Fresh from your successful internship with the famed explorer Tallahassee Smith, you've spotted a market opportunity and decided to go into business for yourself. Your startup, Adventurer Assistance, provides online guidance to teams of adventurers in sticky situations. Your first contract involves providing mission control for teams of three exploring underground cave systems suspected to have been built by aliens, dwarves, the Great Old Ones, or perhaps even all three. Their aim is to reach a treasure cache whose location they have identified. But first they need to navigate through the dark and treacherous caves, and helping them do that right is your job.

Your helpful assistants have already written a graphical user interface for your program, and provided a set of specifications for classes that you must write in order to make it work. When you're done, you'll be able to send commands to the three team members, simply by clicking on their icons and moving them around with arrows. This allows you to trick online gamers into guiding expeditions, by having them think they're playing a 2-D maze game instead.

In practical terms, you will not write a main() method at all, just the functionality that main() already expects in order to function. In effect, you're writing a library to be used by the prewritten GUI code.

The caves are laid out in a regular two-dimensional grid pattern, which you have named the Board. Each cell of the grid represents a single cave in the cave system. A cave is big enough to hold exactly one person (the builders were apparently rather small), and is connected to its four neighboring caves to the North, South, East and West.

However, not all caves are accessible. While some caves are open, others may have been blocked by a cave-in, and cannot be entered. Some others contain bottomless pits that will be the end of any unwary explorer that walks into them. And finally, certain caves are teleport locations that will instantly transport anyone who enters to a random open cave anywhere on the Board. These are especially problematic because we usually can't tell where they are, except by entering and getting teleported.

A team is composed of three people, with unique specialties:

1. Miner: A demolition expert. If he moves into a location with a cave-in, he will destroy the rocks blocking it off, converting it into an open cell.

2. Filler: A vertical descent safety specialist who can fill in bottomless pits. If he enters a location with a pit in it, the pit will be filled in and the cave will be considered open.

3. Adventurer: The intrepid leader of the expedition. She is the one who must reach the treasure cache in order to achieve mission success, because the other two don't look as good on camera, and 21st century adventuring is really all about the post-adventure merchandising deals. She is equipped with a cutting-edgeTeleport Interdiction System. As a result, if she enters a teleport location, she will not get teleported. Instead, that location will be marked on the Board, so that the other two can avoid it (or risk it, if necessary). Unfortunately, she can't enter blocked-off caves, and will be killed if she walks into a cave with a pit in it. If she dies, the mission ends, and is considered a failure.

Neither of these three can leave the cave - the boundaries are impenetrable. The only way out is to get the Adventurer to the treasure in the bottom-right corner of the Board.

At the start of the game, a random board is generated. (The reason for this is complicated, and involves a series of unfortunate accidents involving a time machine and a random number generator.) The Adventurer is at the top-left location, and the Miner and Filler are at random open caves on the Board, having gone in earlier. Such is life for a professional sidekick.

To model this situation, you must write the following set of classes. (See documentation for precise technical details on what you should implement.)

1. Cave: A class that represents a single cave. Its instance variables contain information on its position on the Board, the type of cave it is (open, blocked, pit, teleport), and various instance methods described fully in the docs.

2. Board: Represents the game board. It contains a 2-D array of Caves, and is responsible for generating a random cave system, among other things.

3. Character: An abstract base class representing members of the team. It handles common functionality, like moving from a cave to an adjacent cave and getting teleported if it contains a teleport location. The classesAdventurer, Miner and Fillerare descended from it, and override its methods to model their unique behavior.

4. Adventurer: A subclass of Character that represents the leader of the expedition. Incorporates the special ability to be immune to teleportation and mark teleport locations.

5. Miner: A subclass of Character that represents the miner, and incorporates his special ability to clear blocked caves.

6. Filler: A subclass of Character that represents the filler, and incorporates his special ability to fill up pits.

7. CaveWorker: An interface that represents the ability to change a non-open location to an open one (by filling a pit or blowing up rocks).

You will be provided with the main class AdventureGamethat will generate the game interface and handle input/output. You DO NOT need to alter this file for the normal assignment. (See the extra credit section below for the situation where you might want to alter it.)

The folders icons and icons64 provided for you must be placed in your project folder. The image files in them are used as part of the GUI.
Input/Output

You don't need to worry about input/output, this will all be handled by the prewritten classes we will provide.

Extra Credit (Optional)

An additional Webcourses assignment will be created, marked Assignment 4E. This is the extra credit assignment. On this one, you can add new features, overhaul the GUI, soup up the game in crazy ways - basically be as creative as you want. Up to 20 points of extra credit are available for this, which comes to 7 extra points added to your final grade at the end of class. We'll show off the coolest submissions in class.

NOTE:You still need to submit the original assignment! Please avoid adding extra features to the original one - reserve your creativity for the extra credit.

Deliverables

Submit the source files over Webcourses as an attachment. In particular, do not submit any .class files!!! This will result in 0 credit for the assignment. You must send your source files as an attachment using the "Add Attachments" button. Assignments that are typed into the submission box will not be accepted.
Restrictions

Your program must compile using Java 6.0 or later on the command line. Your programshould include a header comment with the following information:

Your name

Course number, section number

Short description of the code

Java, Programming

  • Category:- Java
  • Reference No.:- M9532264

Have any Question?


Related Questions in Java

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As