#include #include using namespace std; double safedivide(int top, int bottom) throw (int) { if (bottom == 0) throw top; return top / static_cast(bottom); } main() { int donuts, milk; double dpg; cout << "Enter number of donuts:\n"; cin >> donuts; cout << "Enter number ofglasses of milk:\n"; cin >> milk; try { dpg = safedivide(donuts, milk); } catch(int e) { cout << e << " donuts. and No Milk!\n" << "Go buy some milk.\n"; exit(0); } cout << donuts << " donuts.\n" << milk << " glasses of milk.\n" << "You have " << dpg << " donuts for each glass of milk.\n"; }