Design the interface classes drawable rotatable and sounds

Assignment Help JAVA Programming
Reference no: EM131324320

Discussion, please respond to the following prompt:

• Compare and contrast abstract classes and interfaces. In what situations would you use an abstract class? in what situations would you use an interface?

Imagine your project team is developing a Java application that will serve as an educational tool to help children learn about various concepts such as vehicles, animals, sounds, etc. The application will have a need to draw various objects (e.g., animals, vehicles) on the video display as well as to rotate objects, resize objects, and play sounds that are associated with the objects. Your project manager has specified that all objects in the application should use a common interface for drawing, rotating, resizing, and playing sounds, and that these interfaces should be reusable for other application projects as well. Some future applications will need to make sounds, some will need drawing capability, some will need rotating capability, some will need resizing capability, and some will need all capabilities. A method called drawObject() will be used for drawing objects, a method called rotateObject() will be used for rotating objects, a method called resizeObject() will be used for resizing objects, and a playSound() method will be used for playing sounds.

1. Design the interface classes Drawable, Rotatable, Resizable and Sounds.

2. Develop a program called ManipulateAnimals that does the following: An Animal class will be used to model some basic characteristics of animals for the application. An animal will have a name attribute and methods to set the name and get the name.

Animals can make sounds and are drawable, rotatable, and resizable. A Vehicle class will be used to model some basic characteristics of vehicles. A vehicle will have a name and an age, and methods to get/set these attributes. Vehicles can also make sounds and are drawable, rotatable, and resizable. Create a collection of 2 vehicles and 2 animals stored in the same array. Loop through the array and execute the drawObject(), rotateObject(), resizeObject(), and playSound() methods polymorphically for each element in the array. The drawObject() method should simply display the message "Drawing a Vehicle" or "Drawing an Animal"; the rotateObject() method should display the message "Rotating a Vehicle" or "Rotating an Animal"; and the playSound() method should display the message "Animal sound" or "Vehicle sound", depending upon the type of element that is in the array. The resizeObject() method should display "Resizing a Vehicle" or "Resizing an Animal".

Reference no: EM131324320

Questions Cloud

Create an application that calculates the average salary : Create an application that calculates the average and highest salary of Major League Baseball players in 2011 and 2012.
What is the enterprise value-ebitda multiple : The market value of the equity of Ginger, Inc., is $740,000. The balance sheet shows $48,000 in cash and $236,500 in debt, while the income statement has EBIT of $105,500 and a total of $171,500 in depreciation and amortization. What is the enterpris..
Who was more responsible for the outbreak of the cold war : Who was more responsible for the outbreak of the cold war between the United States and the Soviet Union:  S. Truman, or Joseph Stalin
What were the perspectives of the workers during strike : What were the perspectives of the workers and management (mainly Carnegie but also Frick) during the Homestead strike? Could Carnegie have compromised on the issues between him and the union? Or was there an irreconcilable conflict which had to be..
Design the interface classes drawable rotatable and sounds : Design the interface classes Drawable, Rotatable, Resizable and Sounds. Compare and contrast abstract classes and interfaces. In what situations would you use an abstract class? in what situations would you use an interface?
The firm accept if the payback period is three years : Which projects will the firm accept if the payback period is three years? Which projects will the firm accept if the discounted payback period is three years? (Show math) What is the IRR for each of the three projects? What is the MIRR for each of th..
About the holding period yield : The YTM on a bond is the interest rate you earn on your investment if interest rates don’t change. If you actually sell the bond before it matures, your realized return is known as the holding period yield (HPY).  Two years from now, the YTM on your ..
What companies are delivering cloud services : Defend your position or thinking! A good starting point for this discussion would be a clear definition of the 'cloud,' if one can be had. What companies are delivering cloud services, and what is it you can buy from them?
Did your algorithm perform the correct calculations : Did your algorithm perform the correct calculations? Where applicable, would a more efficient API or algorithm have been used to implement something in a better way?

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Analyze some of the limitations a web designer should aware

Analyze some of the limitations a Web designer should be aware of before adding JavaScript to a Website. Determine if these limitations outweigh the benefits of using JavaScript. Explain your decision.

  When the user presses a button

When the user presses a button, get the text from text field. Now extract the words from the text one at a time and find the largest word of length 4 or more. Let's call this largest word X for now. In response, create a question based on the length ..

  Process of buying a soda from a soda machine

Please write a Java Program those steps through the process of buying a soda from a Soda Machine.  You must interact with the consumer. Each Soda is one dollar.

  Simulate a simple multiuser computer system

Prepare a java program to simulate a simple multiuser computer system

  Main method to test a student graduate record examination

I need a Java solution named TestGRE.java with a main method to test a Student Graduate Record Examination Score Managment System using BinarySearchTree java classes.

  Why is overloading useful

Overloading is a way of using the same method name for multiple methods as long as the number / types of arguments are different. Why is overloading useful? Give an example of how this could be used.

  Difference between global and local variables

What is the difference between Global and Local variables - Write a JavaScript function that takes arguments as two numbers, multiplies and returns the result.

  Write a method, insertat that takes four parameters

Write a method, insertAt that takes four parameters

  Determines and displays the smallest and largest

Create a method that determines and displays the smallest and largest of the ten values. Then, pass the array to the method - Create a GUI application whose button's Click() method accepts ten integer values from a TextBox and stores them in an arra..

  Method that reads a text file and returns a list of tokens

Write a method that reads in a text file and returns a list of the tokens (preferably alphanumeric) in that file. Write a method to print out frequency results.

  Object-oriented gui drawing editor

A simple object-oriented GUI drawing editor that allows a user to create, move and erase rectangles, squares, circles and lines in an interactive graphics. How can I draw move erase rectangles, squares, circles and lines in GUI/java.

  A java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

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