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:

var
bounce : integer;
distance, final_height : real;


Begin
writeln('Please enter height of first bounce:');
readln(distance);
for bounce :=1 to 1 do
writeln(bounce);
begin
distance := (10.0 * 0.9) * bounce;
writeln(final_height:8);
end
End.

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.

Recommended Answers

All 2 Replies

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.