Dangerousmonster which inherits the monster

Assignment Help JAVA Programming
Reference no: EM13163668

For the below descriptions your task is to draw a UML class diagram showing the various interfaces and classes

  1. An interface - Monster with a method menace() with return type as void

  2. An interface - DangerousMonster which inherits the Monster interface and has a method called destroy() with void return type.
    (Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends" keyword.

  3. An interface - Lethal with a method - Kill( ) with void return type.

  4. A class DragonZilla which implements DangerousMonster. This class does not have any methods of it's own but provides implementation for the methods from DangerousMonster. The implementation of these methods simply prints meaning full statements that includes the name of the class and method using System.out.println() eg. "DragonZilla can be menace to children"

  5. An interface - Vampire that extends DangerousMonster and Lethal interfaces. This method has it's own method - drinkBlood( ) with return type as void.
    (Note: An interface can inherit from multiple interfaces but a class can inherit from at most one Class.)

  6. A class VeryBadVampire that implements Vampire interface. The methods that are inherited would simply provide an implementation that will print the name of the class and name of the method just like in step d.

  7. A class HorrorShow with the following implementation.

public class HorrorShow

{

public static void u(Monster b)

{

b.menace();

}

public static void v(DangerousMonster d)

{

d.menace();

d.destroy();

}

public static void w(Lethal l)

{

l.kill();

}

public static void main(String[] args)

{

DangerousMonster barney = new DragonZilla();

u(barney);

v(barney);

Vampire vlad = new VeryBadVampire();

u(vlad);

v(vlad);

w(vlad);

                        }

}

Reference no: EM13163668

Questions Cloud

The sport of gymnastics requires both impressive : The sport of gymnastics requires both impressive physical strength and extensive training for balance. The iron cross is an exercise performed on two suspended rings
Write an isr and startup code for a system that lights up le : Write an ISR and startup code for a system that lights up LED0 on the PSoC Eval1 board (assuming that a wire is connecting P1[0]) to indicate "Low Voltage"
Automated emails from google apps spreadsheet ? : How to send automated emails from google apps spreadsheet ?
Investigate the weaknesses that arise in elgamal encryption : investigate the weaknesses that arise in Elgamal encryption if a public key of small order is used. We look at the following example. Assume Bob uses the group Z
Dangerousmonster which inherits the monster : An interface - DangerousMonster which inherits the Monster interface and has a method called destroy() with void return type.(Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends..
Create a website that would allow users to enter and submit : Create a Website that would allow users to enter and submit survey
Create huffman codes : Write a C++ program to create Huffman codes. Program input is a file called freq.txt (make up your own file for testing) that contains data on the characters in some cleartext file in the form of each character's non-zero frequency of occurrence i..
Discuss the issues that managing and implementing : Discuss the issues that managing and implementing the technology architecture you would have and how you would overcome these challenges. Be sure to discuss at least three challenges.
Give a recursive definition of s. : Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

Reviews

Write a Review

JAVA Programming Questions & Answers

  One-dimensional array to solve the

In C#, Use a one-dimensional array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who gros..

  Create java program to find number of days left in that year

Create a Java program called "DaysLeftInYear.java" that outputs the number of days left in that year. use the calendar class to represent dates. Use the DateFormat class to display the current date in the output.

  Create the working applet to compute tax

Write down a java applet. Your applet assits to find out how much federal tax we require to pay suppose the tax rate is 12%. Create and implement the working applet to compute tax.

  Design an application for pizza order process

Create an application to take and procedure a pizza order. The user should be able to make pizza order choices from listboxes, and the application should show the order price.

  Can linear search algorithm be encoded using recursion

Determine the average amount of time people spend waiting for tables and provide examples from the "real world" of unsorted lists, sorted lists, indexed lists, lists that permit duplicate elements, and lists that do not permit duplicate elements

  Sorting routine adopted in the java api for arrays.sort()?

What is the sorting routine adopted in the Java API for Arrays.sort()? How different is it from the sorting routine we discussed in class? Is it better? Explain your answers in short clear sentences.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Create java application which creates random phone number

Create and implement Java application which creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output.

  Write java program to reads ten values from user

Write the java program which reads 10 values from user and store them in 1 daimantion array. your program will ask the user wich operation he wants to perform:

  Java program to create a tree

Java program to create a tree, generate class - BottomUpTwoThreeFourTree, BottomUpTwoThreeFourTree,

  Technical community blog

Write a blog article for a coding/technical community blog

  Please write the code in java

Please write the code in java for  Recursion,  Sorting and Searching

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd