Write a program that displays a countdown first

Assignment Help JAVA Programming
Reference no: EM13845192

Problem Summary and Equations

When an object is dropped or thrown from an initial position (height), formulas can be used to determine the object's position (height) and velocity at each second, as it drops.

The position of a falling object can be calculated using the equation:
P(t) = -16t2 + V0t + H0
where:
t is time in seconds
P(t) is the position of the object at after t seconds,
V0 is the initial vertical velocity of the object in feet/sec, and
H0 is the initial height of the object in feet.
Likewise, the velocity of the object at any given time can be calculated from the equation:
V(t) = -32t + V0
where:
t is time in seconds
V(t) is the velocity of the object at after t seconds, and
V0 is the initial vertical velocity of the object in feet/sec

Example: Assume we drop a ball from an initial height of 1000 ft. (H0 = 1000.0) above the Earth. Since we dropped the ball and didn't throw it, its initial velocity is 0 ft/sec (V0 = 0.0). At zero, the ball is not moving up or down.

Now we can ask:

How high above the ground and how fast is the ball traveling after 5 seconds (t = 5)?

To determine these values, simply plug in all the numbers to the previous two equations:
P(5.0) = -16(5.0)2 + (0.0)(5.0) + 1000.0 P(5.0) = 600.0
V(5.0) = -32(5.0) + 0.0 V(5.0) = -160

Hence, after 5 seconds, the ball will be 600 feet above the ground traveling downwards at 160 ft/sec (downwards because of the negative sign).

Program Requirements

Write a program that displays a countdown first, and then displays the position and velocity of an object for every second it drops, as long as it is above 500 feet

Required Control Structures

Within this program, you must use at least one of each of the following programming constructs:
· while loop
· do-while loop
· for loop

Required Classes and Methods
Two separate classes will be required for this program.
1. Define a class with properties and methods for a falling object.

The class will have the following private properties:
constant initial position
constant initial velocity
current time
current position
current velocity

Reference no: EM13845192

Questions Cloud

Argument for both sides of a debate : Your task is to create an argument for both sides of a debate.
What is the imfs overall outlook for south korea : What is the IMF's overall outlook for South Korea? What impact will the condition of the global economy have on the country? What are the domestic risks facing South Korea?
Educational experience and course work : Prepare a list of at least three job-related assets that you have and explain why and how these qualities would be useful to a potential employer.
What is the risk to a business for not applying technology : Explain how you can use the technology in an organization for competitive advantage. Address Porter's Five Forces model (see picture below). What is the risk to a business for not applying/using the technology?
Write a program that displays a countdown first : Write a program that displays a countdown first, and then displays the position and velocity of an object for every second it drops, as long as it is above 500 feet
Define cloud computing and discuss : Define Cloud Computing and discuss whether it is disruptive or evolutionary to CA Technologies.
Chief expectations for yangban women : In Choson Korea, what were the chief expectations for yangban women? What were the chief expectations for yangban men?
Paper on assimilation or pluralism : Paper on Assimilation or Pluralism
Mobile technologies in a user-friendly manner : The items need to be easily searchable and of sufficiently high resolution for details to be viewed. They need to be accessible through mobile technologies in a user-friendly manner. The University also wants a way to protect the copyright of the ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Achieving simplicity and merely being simplistic

What is the difference between achieving simplicity and merely being simplistic?

  Create a login form

In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not

  Portable file system implement a portable file system with

implement a portable file system with java language. i do have some requirements.implement a portable file system pfs.

  Write java program to enter number of marks

Write a java program called AverageMark.java. This program should allow the user to enter any number of marks and then display the minimum, maximum & average mark.

  Overview in this assignment you are provided with an

overview in this assignment you are provided with an interface that contains a generic type.you are asked to create two

  Modify the scholarship application

Modify the Scholarship application so that if a user enters a grade point average under 0 or over 4.0, or a negative value for either of the activities, an error message appears.

  The drink machine should have a supply

When the applet starts, the drink machine should have a supply of 20 of each of the drinks. The applet should have a text field where the user can enter the amount of money he or she is giving the machine. The user can then click on a button to selec..

  Discuss: inheritance loops and conditional statements

"The process of identifying the classes or functions for replacement" - I you can also define things that are used in the program. ie, define and discuss: inheritance, loops, conditional statements, variables, methods, objects, IDEs, and so on.

  Create a gui client side application that is a java version

q1. create a gui client side application that is a java version of notepad giving the ability to open modify and save

  Modify your server to make it multithreaded your server

modify your server to make it multithreaded. your server should allow more than one client to connect and request

  Write a class named test scores

Write a class named TestScores.The class constructor should accept an array of test scores as an argument.The class should have a method that returns the average of the test scores.

  Write a class house that correctly compiles and runs

Write a class House that correctly compiles and runs with the following TestHouse code. You cannot change a single thing in the TestHouse 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