Write a program to provide information on the height of a ball thrown

straight up into the air. The program should request the initial height, h

feet, and the initial velocity,v feet per second, as input. The four options to

be provided by buttons are as follows:

(3) Determine the maximum height of the ball. Note: The ball will reach

its maximum height after v/32 seconds.

(b)

Determine approximately when the ball will hit the ground. Hint:

Calculate the height after every . 1 second and observe when the height

is no longer a positive number.

(c) Display a table showing the height of the ball every quarter second for

five seconds or until it hits the ground.

(d) Quit.

The formula for the height of the ball after t seconds, h + v*t — 16*t*t should

be specified in a user-defined function. (Test the program with v = 148 and h = 0.

This velocity is approximately the top speed clocked for a ball thrown by a proffesional

baseball pitcher.It is homework help. I honestly do not know where to begin after designing the form. Any help would be great. I figured I would try and get some sort of help if someone was bored and willing.

Thanks!

I'm bored but I'm not that bored. Design the code to do the calculations first then think about how you are going to display the output. You have all the information you need, all you need to do is to apply a little logic and thought. That is what programming homework is meant to do, teach you how to think, not how to ask questions on an on-line forum.

If you are still stuck then it's back to your tutor. I take it you do know how to programme a While/Wend loop.

Stuart

I have the correct equations set and working. The part that I am stuck on is how to format the output neatly into two columns in the listbox. Any ideas??

It is awkward to format two columns in a list box. You would be better using a two column grid control or two separate but linked list boxes. A two column grid control is by far the easiest. Stuart

Alright. Also, what would be the easiest way to add the solution to the grid control after each loop until the loop ends?

Use the Grid control Additem function with an Index counter. Stuart

Ask Your Question

Weekly Poll