/* Jan24b.cpp Dave Klick CIS 150 2017-01-24 Assignment #1 Simple I/O with strings. */ #include #include using namespace std; int main() { // storage (declare variables) int age; string name; // input cout << "Enter your age: "; cin >> age; // cin will leave a newline in the keyboard buffer // getline will interpret that as its end of input // so we eliminate that newline using cin.ignore() cin.ignore(); cout << "Enter your name: "; getline(cin, name); // processing - none // output cout << "Good evening, " << name << endl << age << " is amazingly old - but you look older\n"; // pause cout << "Press Enter to continue..."; cin.ignore(200, '\n'); cin.get(); return 0; }