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

  Quadratic and double hashing

The methods you should use in building your has functions are linear, quadratic and double hashing. Your code should provide create, insert, ?nd and delete operations on that table.

  Develop a java program given the width, length and depth

Write the source code for each class in a separate file which must have the same name as the class name together with the extension .java. Remember also that by convention, class names commence with a capital letter.

  How to detect the correct ip address and run it locally

When you compile the two modules, with disabling the package statement, it runs on one single machine, that's running the server

  Developing prototype applet for web inventory management

As a lead systems developer for iDev3, you have been assigned as a consultant to work with Wrigley Inc (the gum company). Your project consists of developing a prototype applet for web-based inventory management

  Write a java program in a netbeans project that reads a

write a java program in a netbeans project that reads a text file containing the names and addresses of several people

  Conduct an internet search for javadb tutorial you might

please write a 200-400 word response to the following questionq1. conduct an internet search for javadb tutorial. you

  Create your listarray class

Create your ListArray class that is functionally similar to the formal Java ArrayList Utility class. here are the requirements

  Create a program that has an object type of contact

Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color

  Write java program that writes names to text file

Create an empty text file called myfile.txt. Write a Java program that writes your names to the text file created. If the file does not exist, include an exception handler for that error.

  Write a class lines containing a static method

Write a class Lines containing a static method dashedLine to draw dashed lines, so it can write:

  Write a program that reads in a list of numbers from a file

write a program that reads in a list of numbers from a file and adds up all those numbers. You may hard code in the name of the file, allowing the user to input the filename is not required

  Write a program in java that reads contents of two vectors

Write a program in Java that reads contents of two vectors, and then displays the sum of these two vectors. The program should prompt the user to enter the size of the vectors first.

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