// divides ice-cream between people \ // demonstrates the use of void-function // Walt Savitch // 10/3/00 #include using namespace std; // initializes screen void initalize_screen(void); // outputs how much ice-cream each customer gets void ice_cream_division(int, double); int main(){ initalize_screen(); cout << "Suppose you divide 100 ounces of ice cream" << " among 12 people.\n"; ice_cream_division(12, 100); } // initializes screen void initalize_screen(void){ cout << endl; } //Outputs instructions for dividing total_weight ounces of ice cream //among number customers. If number is 0, nothing is done. void ice_cream_division(int number, double total_weight) { double portion; if (number > 0){ portion = total_weight/number; cout << "Each one receives " << portion << " ounces of ice cream." << endl; } }