I have the worst time deciding on VAR statements. I am trying to write a program to establish a "bounciness" index equal to the original height divided by the bounce height of a ball. I get the basics of the FOR looping, but my VAR statements just don't make sense, which means my Readln statement shows nothing. Here is what I have so far:

bounce : integer;
distance, final_height : real;

writeln('Please enter height of first bounce:');
for bounce :=1 to 1 do
distance := (10.0 * 0.9) * bounce;

It compiles correctly, and asks me to enter the height of the first bounce, but when I enter a number (10) nothing happens. My Vars just aren't asking for the right information. Any ideas? Thanks.

call me crazy, but it appears that you are running a loop that only runs one time. Why?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.