Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment

When you complete a task, show it to me, and I will record that you got points for that task.

The listed due date is the last day we will have to work on these problems in-class. Any tasks you show me during class or e-mail to me by midnight that day will be worth full credit. (I will usually still ask to see e-mailed problems in class the next day.) After that day, tasks will earn you 20% fewer points per day. You can still get full credit on the assignment for 3 class days after the due date.

For all these problems you are required to use arrays and loops to avoid writing similar lines of code many times. Additionally, if only some elements of an array are relevant, you should make sure your code only uses those elements.

Tasks

1) Write a program that, every time you click the mouse, creates an ellipse at the mouse's location. The ellipse should then gradually move down at a constant rate. You don't need to worry about removing the ellipses from the array when they leave the screen, or making them stay on the screen.

2) Write a program that, whenever you press a letter key, displays that letter at the current location of the mouse (and keeps it there). This doesn't need to behave nicely if you press non-letter keys. (Hint: You will need to create a String array. In order to turn the key variable into a String, you can just add it to an empty string, like this: ""+key. There's no space in between those quotes.)

Tasks

1) Write a program that creates an ellipse every time you click the mouse, at the mouse's location. If you press 'a', then it should erase the earliest drawn ellipse that is still showing. If you press 'z' then it should erase the most recently drawn ellipse that is still showing.

2) Write a program that creates a rectangle every time you click, drag, and then release the mouse. One corner of the rectangle should be where you click the mouse, and the opposite corner should be where you release the mouse. The rectangle doesn't need to be shown while you are dragging the mouse, it can just show up when you release the mouse. (Hint: you will probably want to use the mousePressed() method to record where you click the mouse, and the mouseReleased() method to actually create the rectangle.)

Tasks

1) Write a program that allows you to "throw" ellipses on the screen. Whenever you click, drag, and release the mouse, it should create an ellipse where you release the mouse. The velocity of the ellipse should be proportional to how far you dragged the mouse...the further you dragged it, the faster it goes... and should be in the direction you dragged the mouse. (Hint: this means that the x-velocity should be proportional to x-distance you moved the mouse, and y-velocity is proportional to y-distance.) The ellipse should then bounce around the screen. Make it so that the ellipses move at a reasonable velocity for reasonable mouse movements, not super fast.
a. You can turn this into a 30 point task by having each ellipse bounce 3 times, and then disappear.

2) Write a program that creates ellipses at the bottom of the screen. They should always start out moving upwards, but they should have a random x velocity (that includes sometimes being to the right and sometimes being to the left). They should also all accelerate downwards (gradually changing y velocity). After they reach their peak and start falling back down, they should disappear when they are within 100 pixels of the bottom of the screen.

Tasks

1) Write a program that starts with several ellipses bouncing around the screen. Every time you click the mouse, it should create a black dot (a small ellipse) that moves straight upwards. If a dot hits one of the bouncing ellipses, both the dot and the big ellipse should disappear (and be removed from their respective arrays). If the dot gets to the top of the screen, it should disappear and be removed from its array.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92285984
  • Price:- $85

Priced at Now at $85, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

  • 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