#include #include using namespace std; int main() { int pounds {0}; cout << "How many pounds (whole number, at least 1) does it weigh?\n"; cin >> pounds; if (!cin) { cerr << "Sorry, that wasn't a valid whole number.\n"; return EXIT_FAILURE; //pounds dies here; minutes not born yet. } if (pounds < 1) { cerr << "Sorry, the weight must be at least 1 pound.\n"; return EXIT_FAILURE; //pounds dies here; minutes not born yet. } //Formula from David Foster Wallace, "Consider the Lobster". int minutes {10 + 3 * (pounds - 1) - 3}; //Simpler expression with the same value: //int minutes {4 + 3 * pounds}; cout << "Simmer the soft shell lobster for " << minutes << " minutes.\n"; return EXIT_SUCCESS; //pounds and minutes die here. }