Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M91976960
  • Price:- $80

Guranteed 48 Hours Delivery, In Price:- $80

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As