Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Polymorphism

After you release the revised Super Happy Fun Cute Creatures World Traveler from Homework 3, the game gains worldwide popularity. Kids and adults from Europe to Asia to North America are playing it, and you even get fan mail from one random scientist down in Antarctica.

But a game company's work is never done! You decide it's time to break into the niche market of space combat simulators. The basic idea behind your sim is that you control a spaceship that can fire different types of weapons. Each weapon has its own attack damage and load time. (Generally speaking, longer loading weapons should give you higher damage, and vice versa.)

1. Implement the following classes and interfaces:

a. An interface Drawable that contains a single method, draw(). This interface will be implemented by any classes representing game objects that you want to draw on the screen. This makes it so the game engine (which you don't need to write for this assignment...) can treat every object you want to show on the screen as type Drawable, and it can simply call draw() on each of those objects to renderit.
b. A class Spaceship that implements Drawable. For now, the draw() method can just display some text - make this as simple or elaborate as youwant!
c. An abstract class Weapon that contains instance variables for damage and load time. Weapon should also contain an abstract method fire(), and it should implement a Comparable interface by providing a compareTo(Comparable c) method based on the load time. Finally, Weapon should implement Drawable with the abstract methoddraw().
d. A Laser subclass of Weapon. Laser must implement the fire() and draw() methods inheritedfrom
Weapon. Both methods can just display some text - be as simple or elaborate as you want!
e. A SingularityCannon subclass of Weapon. SingularityCannon must implement the fire() and draw() methods inherited from Weapon. Both methods can just display some text - be as simple or elaborate as youwant!

Include some way to specify the damage and load time of your Weapon objects. This could be via setter methods, constructors, randomly assigned values in some range, or some combination thereof.

Attachment:- Inheritance.zip

Java, Programming

  • Category:- Java
  • Reference No.:- M92411474
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

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 ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Assignment - java program using array of objectsobjectives

Assignment - 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 Menu ...

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 -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 ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

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 ...

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 ...

  • 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