Create a class mickymouse according to the uml

Assignment Help JAVA Programming
Reference no: EM131221018

Programming Assignment

MickeyMouse
- x : int
- y : int
- size : int
-color: Color
+ MickeyMouse():
+ setLocation (x: int, y: int): void
+ setSize (size: int): void
+ setColor(color: Color):void
+ draw(canvas: Graphics2D) : void

Write a graphical Mickey Mouse program. It will consist of three parts. A MickeyMouse class that encapsulates the drawing of the head and ears of Mickey. Second, a MikeyMouseClubhouse that extends JComponent that is responsible for drawing several Mickey's. Finally, a MikeyMouseClubhouseViewer that will create a window frame to show your creation.

166_Figure.jpg

MickeyMouse

- x : int

- y : int

- size : int

-color: Color

+ MickeyMouse():

+ setLocation (x: int, y: int): void

+ setSize (size: int): void

+ setColor(color: Color):void

+ draw(canvas: Graphics2D) : void

Create a class MickyMouse according to the UML.
- Create a constructorthat sets the x, y, and size instance variables to zero. Set the color to Color.BLACK.
- setLocation should assign the (x,y) coordinate location by assigning the input parameters to their respective instance variables.
- setSize should set a new size by assigning the input parameter to their respective instance variables.
- setColor should update the color instance variable color.
- draw should display the head and ears of MickeyMouse on the provided Graphics2D input parameter accordingly:
o The LEFT ear should be at (x,y) with a diameter of size * 2
o The RIGHT ear should be at (x + size*4, y) with a diameter of size * 2
o The HEAD should be at (x + size, y + size) with a diameter of size * 4

Author a MickeyMouseClubhouse class that extends JComponent, within paintComponent method to draw:
- Construct a MickeyMouse object at (10,10) with size 10 and color green, draw a MickeyMouse
- Move your MickeyMouse object to (400, 10) (use setLocation), then draw another MickeyMouse of color blue.
- Move your MickeyMouse object to (100,150), set size to 50, color black, and then draw again.

Finally, create a MikeyMouseClubhouseViewer that
- Implements the main method and create a JFrame object.
- Instantiate a MickeyMouseClubhouse and attach it to the frame.
- Display the title of the JFrame, i.e. "Welcome to the Mickey Mouse Clubhouse"
- Remember to consistently indent your code and descriptively name your variables.

Reference no: EM131221018

Questions Cloud

Determine how fast he must hit the ball to land : Perform a brief experiment to determine whether there was a better angle at which to hit the ball so that it could clear a 12 ft fence.
Management and leadership compliment : How do management and leadership compliment each other within the organization?
Compute the maximum flow rate of my shower : Write a script to compute the maximum flow rate of my shower (in cubic feet per minute) that keeps the water temperature above 100 deg F.
Summarize the job prospects for these positions : Consider the range of positions included on the Early Childcare and Education Career Guide Web site. Looking only at the position titles and career areas (and not at the information provided on the links), explain two insights or conclusions that ..
Create a class mickymouse according to the uml : Create a class MickyMouse according to the UML - Implements the main method and create a JFrame object and draw should display the head and ears of MickeyMouse on the provided Graphics2D input parameter accordingly:
Fairly common practice : This was something that he found very odd when he first started working for the company, but he later realized it was a fairly common practice. He recognized that this was one of the advantages of this type of corporation.
Do some research on the consumer financial protection bureau : How do existing and proposed regulations affect the fees and interest you pay if you are late paying a credit card bill, transfer a balance between cards, or take a cash advance?
How many d cell alkaline batteries would be needed for this : How many D cell alkaline batteries would be needed for this?
Direct effects of goals on strategy : Direct Effects of Goals on Strategy There are four ways that goals directly affect negotiation. Provide an example of a negotiation situation from the experience, where one of the four ways directly impacted the selection of your strategy.

Reviews

len1221018

9/26/2016 8:54:23 AM

I attached the instructions. you will use use Java software to do the assignment Also, please when you do the assignment, follow the same style of the following example: import java.awt.Rectangle; public class AddTester_E2_4 { public static void main(String[] args) { Rectangle box=new Rectangle(5,10,20,30); newWidht=widht+x-new newWidth = (20+5+0) newWidht=25 newHeight=height+y-newy newHeight=30+10+0; newHeight=40 System.out.println ("Expected:"); System.out.println ("x=0""+""+""y=0"); System.out.println ("width=25""+""+""height=40"); box.add(0,0); System.out.println ("After calling add(0,0) method"); System.out.println ("x="+box.getX()); System.out.println ("y="+box.getY()); System.out.println ("Width ="+box.getWidth()); System.out.println ("Height ="+box.getHeight()); } }

Write a Review

JAVA Programming Questions & Answers

  Determine which of a set of integers are prime numbers

Describes the trial division algorithm as Given an integer n, the integer to be factored, trial division consists of systematically testing whether n is divisible by any smaller number.

  Prepare demo program that implements all of above method

Specify, design, and implement a class that can be used in a program that simulates a combination lock.

  In java programming what is the size of double variable

In java programming What is the size of double variable?

  Create a webpage that prints

Write a programme to create a webpage that prints the name of the STUDENT database in Wide Latin font and set the subtitle with description of the STUDENT to the screen. Set the page layout to the webpage.

  Insert uml design diagrams, use case, classes

Insert UML design diagrams here (use case, class, and sequence diagram).

  Feature of object-oriented programming

Use the Internet or Strayer databases to research the advantages, features, and common examples of OOP and EDP. Describe at least one (1) feature of object-oriented programming that Visual Logic lacks

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  Compare swing java gui components to awt components

Compare Swing Java GUI components to AWT components. Explain at least one way the components are similar and at least one way they are different.

  Creates a list of shapes stored in an array

Identify and use the correct syntax of a common programming language (Java) - describe program functionality based on analysis of a given program;

  Displays the calendar for the current month

Prepare a program that displays the calendar for the current month. You will use the Prior and next buttons to show the calendar of the previous or next month.

  Java classes that are implementations of the rectangle class

Write a Java application that enables the user to specify the length, width and location of two instances of a PlaneRectangle and check whether the first lies completely within the second.

  Calculate and display the total retail value of all products

Your application must calculate and display the total retail value of all products sold after all five pairs of inputs are completed - Write a Java application that prompts the user for pairs of inputs of a product number

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