flow chart

• 04-09-2010
rafay07
flow chart
hi
i am a beginner in c++ so i work on flow charts first now plz help me for this problem
a ball is dropped from some height and rebounds 5% less than the original height after how many rebounds the ball will come to resr?
can anybody provide me the flow chart for this program?
• 04-09-2010
rogster001
sounds recursive, what is your current attempt like?
• 04-09-2010
MK27
It's not recursive, and technically a ball which rebounds 5% less than last time is like Zeno's arrow: It never comes to rest.

Code:

```int main() {         float h = 100.0f;         int i = 1;         while (h>0.0f) {                 h -= h*0.05;                 cout << i++ << ":" << h <<endl;         }         return 0; }```
• 04-09-2010
VirtualAce
Flow chart? Haven't used on or created one in years - actually since my high school BASIC class.

I prefer UML and sequence diagrams to some clunky flow chart.
• 04-09-2010
GReaper
Quote:

Originally Posted by MK27
It's not recursive, and technically a ball which rebounds 5% less than last time is like Zeno's arrow: It never comes to rest.

Theoretically yes, practically no because there are limits to all computer numbers!
• 04-13-2010
rafay07
ball rebouncing problem
actually my question is
" ball is dropped from height h i it rebounds 5%less to its previous rebound after how many rebounds the ball will come to rest. "
in this problem word "rest " is mentioned here so there should b rest in the end
• 04-13-2010
MK27
Okay, perhaps we can alter reality to better suit your assignment.

Altho, has Cipher says, computer numbers are not infinitely regressive, so eventually you will reach a height which does not change. However, that will not be zero.

So you need to decide whether a non-zero height can be close enough to "at rest", or what. I guess hovering a billionth of a unit off the ground is more or less at rest.