Creates an ellipse at the mouses location

Assignment Help Programming Languages
Reference no: EM131477247

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.

Reference no: EM131477247

Questions Cloud

What will be the increase in xyz market value : XYZ Corp. is about to borrow $100,000. The terms of the loan specify an annual equal repayment of principal in each of the next 8 years.
Historical significance of the hebrew bible : What do you believe is the historical significance of the Hebrew Bible for Western Civilization? How has it influenced our civilization?
Explanation of the main purpose and scope of the cited work : Value and significance of the work (e.g., study's findings, scope of the research project) as a contribution to the subject under consideration.
Commentary for vitruvian man : Write a two-page in-depth commentary for vitruvian man and, of course, include the image of that work.
Creates an ellipse at the mouses location : 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.
Explain the legislative and executive branches : Explain the Legislative and Executive branches based on the movie & connect to American History (include examples from movie/scenes)
What lab value will best reflect renal function : A nurse is reviewing a client's list of medications and notices that he is taking two anticholinergics.
Divine right of kings and absolute monarchy : Think about the pros and cons of the divine right of kings and absolute monarchy. What was good about these concepts? What was bad?
Calculate the given statistics for the two shares : The table below presents the year-end prices for the shares of Ford and PPG from 1989 to 2001.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create application to allow user to enter a five-dgit number

Create an application that allows the user to enter a five-digit credit card number; assume that the fifth digit is the check digit. The application should use the method.

  Explain what can go wrong in resource management on c++

Explain What can go wrong in resource management on c++?

  Create a class-how to cash goods-give change to customers

Write class called Cashier that directs a cashier how to cash goods and give change to customers. Typical cashier operations are as follows.

  Write application that allows users to enter student id

Write an application that enables users to enter student ID and three exam scores. Provide a method to compute and return the overall exam average.

  Write a procedure should named get_frequencie

Write a procedure should named Get_frequencies that constructs a character frequency table

  Problem related to reading file and doing averege

First the program must read a text file (The user must be able to write the name of the text file) , the text file contains the following: the expenses the company is going to spend. Text file example: Keywords:, #best_project_ever, Expenses:, Equi..

  Create a class called dateprofile

Assignment - Computer Dating, Create a class called DateProfile that has the following private instance members: gender - a char, the gender of the applicant ('M' or 'F')

  Create a class for working with mixed fractions

Create a class for working with mixed fractions. Only 3 private data members are needed: the int whole number part of the fraction, the int numerator of the fraction, and the positive int denominator of the fraction

  Write a program to compute the total bonus amount earned

An employee has committed to save $2000 per month. Write a program to compute the total bonus amount earned by these two employees in the year.

  How to stream data from a a file

How to stream data from a a file.How to stream data from a a file.

  Program-debug and test programming project

Use Visual Basic .Net 2010 to program, debug, and test the following programming project. Modify the Lucky Seven game to present the user with a video poker hand (5 card).

  Create a program that asks the user for the values of x and

in engineering thermodynamics it is sometimes necessary to balance chemical reaction equations specifically for the

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