/RETURNS NUMBER ROUNDED TO THE NEAREST INTEGER.7 INT MAIN( )8 {9 DO...

6 //Returns number rounded to the nearest integer.7 int main( )8 {9 double doubleValue;10 char ans;11 do12 {13 cout << "Enter a double value: ";14 cin >> doubleValue;

Programmer-Defined Functions 109

Display 3.6 The Function round (part 2 of 2)15 cout << "Rounded that number is " << round(doubleValue) << endl;16 cout << "Again? (y/n): ";17 cin >> ans;18 }while (ans == ’y’ || ans == ’Y’);19 cout << "End of testing.\n";20 return 0;21 }