// Test program for countDown of Example 4.12 #include #include using namespace std; int main() { void countDown(int); countDown(3); return 0; } // // Example 4.12. Function to count down from parameter countFrom // to 1, and then to print Ignition, Blast off! // Pre: Integer countFrom has a value between 5 an 1. // Post: A countdown from countFrom has been displayed. // void countDown(int countFrom) { switch (countFrom) { case 5: cout << "5" << endl; case 4: cout << "4" << endl; case 3: cout << "3" << endl; case 2: cout << "2" << endl; case 1: cout << "1"<< endl ; cout << "Ignition"<< endl ; cout << "Blast off!" << endl ; } }