// prints the ball rebounds until the height of the rebound //is less than a pre-set tolerance #include using std::cin; using std::cout; using std::endl; int main () { const double tolleranza = 0.001; cout << endl; cout << " Initial height: "; int rimbalzi = 0; double altezza; cin >> altezza; cout << endl; while (altezza >= tolleranza) { altezza /=2; rimbalzi++; cout << " Rebound # " << rimbalzi << ": height " << altezza << " meters " << endl; } return 0; }