Write a Java program that computes how high the ball will be above the ground after x seconds in the above example? Where x is an input provided by the user. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse to compute the time. Inputs: The program should prompt the user for the height of the building, the initial speed, and the time the ball has traveled (i.e. flight time). The building height should be an integer variable, while the initial speed and flight time are double variables. Create a separate method from main to calculate the height of the ball.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 13SA
icon
Related questions
Question

Hi, I need helping solving this and writing it in Java format. 

3:49
LTE
Chapter 6 Project - new Fall 10-27-20...
h(t) = -144 + 96 + 128 = 80 feet
The height of the ball will be 80 feet above the ground after 3
seconds of flight time.
Write a Java program that computes how high the ball will be
above the ground after x seconds in the above example? Where x
is an input provided by the user.
Step 1. Create an algorithm (either flowchart or pseudocode) that
you will use to write the program. Place the algorithm in a Word
document.
Step 2. Code the program in Eclipse to compute the time.
Inputs: The program should prompt the user for the height of the
building, the initial speed, and the time the ball has traveled (i.e.
flight time). The building height should be an integer variable,
while the initial speed and flight time are double variables.
Create a separate method from main to calculate the height of the
ball.
Name the separate method calcBallHeight and it needs to
have three input arguments: height of building, initial speed,
and flight time of the ball. The output of the calcBallHeight
method will return a double, ballIHeight, that is the height of
the ball when the flight time has elapsed.
Outputs: The program should have this output (below is an
example):
The ball will be <ballHeight> feet above the ground after
<flightTime> seconds of flight time.
Where ballHeight and flightTime must be formatted to two
decimal places, e.g. 12.48, using a printf statement.
Add comments at the top of the class with your First and Last
name.
Step 3. Test your program with a height of 128 feet , an initial
speed of 32 ft/sec, and a flight time of 3 seconds just like the
example problem. Use the Snip It tool in Windows or a similar
tool on the Mac to cut and paste the Eclipse Console output
window into the same Word document as the algorithm in Step 1.
<terminated> C6_Project_New [Java Application] C:\Program Files\Javaljdk-14.0.2\bin\javaw.exe (Oct 30, 2020 10:26:16 AM – 10:26:29 AM)
Enter the height of the building in feet as an integer: 128
Enter the
Enter the
time of the ball as a double: 3.0
The ball ii be 80.00 feet above the ground after 3.00 seconds of flight time.
Step 4. Now vary the flight time of the ball in .5 second
increments to see how high it will go up before it starts to come
down. Show that output as well. You will have to try different
flight times to get close to the maximum height. Keep in mind the
height of the ball will increase until it reaches the top of the curve
then it will start coming down. What is the maximum height the
ball will travel?
12
90
Dashboard
Calendar
Notifications
Inbox
N.
Transcribed Image Text:3:49 LTE Chapter 6 Project - new Fall 10-27-20... h(t) = -144 + 96 + 128 = 80 feet The height of the ball will be 80 feet above the ground after 3 seconds of flight time. Write a Java program that computes how high the ball will be above the ground after x seconds in the above example? Where x is an input provided by the user. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse to compute the time. Inputs: The program should prompt the user for the height of the building, the initial speed, and the time the ball has traveled (i.e. flight time). The building height should be an integer variable, while the initial speed and flight time are double variables. Create a separate method from main to calculate the height of the ball. Name the separate method calcBallHeight and it needs to have three input arguments: height of building, initial speed, and flight time of the ball. The output of the calcBallHeight method will return a double, ballIHeight, that is the height of the ball when the flight time has elapsed. Outputs: The program should have this output (below is an example): The ball will be <ballHeight> feet above the ground after <flightTime> seconds of flight time. Where ballHeight and flightTime must be formatted to two decimal places, e.g. 12.48, using a printf statement. Add comments at the top of the class with your First and Last name. Step 3. Test your program with a height of 128 feet , an initial speed of 32 ft/sec, and a flight time of 3 seconds just like the example problem. Use the Snip It tool in Windows or a similar tool on the Mac to cut and paste the Eclipse Console output window into the same Word document as the algorithm in Step 1. <terminated> C6_Project_New [Java Application] C:\Program Files\Javaljdk-14.0.2\bin\javaw.exe (Oct 30, 2020 10:26:16 AM – 10:26:29 AM) Enter the height of the building in feet as an integer: 128 Enter the Enter the time of the ball as a double: 3.0 The ball ii be 80.00 feet above the ground after 3.00 seconds of flight time. Step 4. Now vary the flight time of the ball in .5 second increments to see how high it will go up before it starts to come down. Show that output as well. You will have to try different flight times to get close to the maximum height. Keep in mind the height of the ball will increase until it reaches the top of the curve then it will start coming down. What is the maximum height the ball will travel? 12 90 Dashboard Calendar Notifications Inbox N.
3:49
LTE
Chapter 6 Project - new Fall 10-27-20...
Chapter 6 Project
Project Name: Chpt6_Project
Class Name: Chpt6_Project
Projectile Motion
An object is thrown straight up from the top of a building that is h feet tall, with an initial velocity
of v feet per second. The height of the object as a function of time can be modeled by the function
h(t) = -16t + vt + h, where h(t) is the height of the object (in feet) t seconds after it is thrown, and
h is the starting height, i.e. the height of the building
This model assumes the object misses the top of the building on the way back down to the ground
and that wind resistance is minimal.
Example: Assume the ball is thrown straight up from the top of a
128 foot tall building with an initial speed of 32 feet
(ft/sec). The height of the ball as a function of time can be
modeled by the function by:
per
second
h(t) = -16t + 32t + 128.
Note: t equals t times t
How high above the ground will the ball be after 3 seconds of
flight time?
h(t) = -16(3) + 32(3) + 128
h(t) = -144 + 96 + 128 = 80 feet
The height of the ball will be 80 feet above the ground after 3
seconds of flight time.
Write a Java program that computes how high the ball will be
above the ground after x seconds in the above example? Where x
is an input provided by the user.
Step 1. Create an algorithm (either flowchart or pseudocode) that
you will use to write the program. Place the algorithm in a Word
document.
Step 2. Code the program in Eclipse to compute the time.
Inputs: The program should prompt the user for the height of the
building, the initial speed, and the time the ball has traveled (i.e.
flight time). The building height should be an integer variable,
while the initial speed and flight time are double variables.
Create a separate method from main to calculate the height of the
ball.
12
90
Dashboard
Calendar
Notifications
Inbox
OO00
]ロロロ
Transcribed Image Text:3:49 LTE Chapter 6 Project - new Fall 10-27-20... Chapter 6 Project Project Name: Chpt6_Project Class Name: Chpt6_Project Projectile Motion An object is thrown straight up from the top of a building that is h feet tall, with an initial velocity of v feet per second. The height of the object as a function of time can be modeled by the function h(t) = -16t + vt + h, where h(t) is the height of the object (in feet) t seconds after it is thrown, and h is the starting height, i.e. the height of the building This model assumes the object misses the top of the building on the way back down to the ground and that wind resistance is minimal. Example: Assume the ball is thrown straight up from the top of a 128 foot tall building with an initial speed of 32 feet (ft/sec). The height of the ball as a function of time can be modeled by the function by: per second h(t) = -16t + 32t + 128. Note: t equals t times t How high above the ground will the ball be after 3 seconds of flight time? h(t) = -16(3) + 32(3) + 128 h(t) = -144 + 96 + 128 = 80 feet The height of the ball will be 80 feet above the ground after 3 seconds of flight time. Write a Java program that computes how high the ball will be above the ground after x seconds in the above example? Where x is an input provided by the user. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse to compute the time. Inputs: The program should prompt the user for the height of the building, the initial speed, and the time the ball has traveled (i.e. flight time). The building height should be an integer variable, while the initial speed and flight time are double variables. Create a separate method from main to calculate the height of the ball. 12 90 Dashboard Calendar Notifications Inbox OO00 ]ロロロ
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 7 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning