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

  Part - 1build a graphical user interface for displaying the

part - 1build a graphical user interface for displaying the image groups cluster in jmjrst. design and implement using

  Create a class named date that stores date values

Create a class named Date that stores date values

  Use server-side validation to validate all user entries

Use server-side validation to validate all user entries

  supply a student tester class that tests all methods

Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate constructor and methods getName( ), addQuiz(int score), getTotalScore( ), and getAverageScore ( ).

  Template files contain the message text

Template files contain the message text, together with variable fields(such as Dear [Title] [Last Name ] ...). A database (stored as a text file) contains the field values for each recipient. Use HTML as the output file format. Then design and implem..

  An api for a library that provides for all these operations

Quaternions can be represented with four (4) real numbers (a,b,c,d). They can be added, subtracted, multiplied and divided. You can multiply a quaternion by a scalar (which produces a quaternion as a result)

  Develop a java gui application using layout managers

COIT11134Object Oriented Programming - Develop a Java GUI application using layout managers and develop an application that uses two or more classes.

  Statement that catches and handles invalid data

Then, code a constructor that assigns default values to these variables. The default value you assign to the customer variable should prevent a NullPointerException - The parameters of this constructor should be given the same names as the instance..

  Construct the student class student.h

Construct the Student Class Student.h and Student.cpp student class should include a Student.h header file for your class definitions and a Student.cpp implementation file comprised of first name, last name, ram id

  Concept of web based information system

Design and implement a simple and small email server using the concept of web based information system

  How to setup a program to respond to events

Discussing how to setup a program to respond to events from any one of these sources - How do you create the necessary listener class? How do you associate the listener object with the event source?

  Write a general package for reading in arithmetic expression

Write a general package for reading in arithmetic expressions and simplifying them. Write a program for a simple calculating language with two forms of statement.

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