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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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