Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please only post the CORRECT answer. If the answer is incorrect, I will give a dislike. The given program reads a list of single-word first

Please only post the CORRECT answer. If the answer is incorrect, I will give a dislike.image text in transcribed

The given program reads a list of single-word first names and ages (ending with - 1 ), and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a string rather than an int. At FIXME in the code, add a try/catch statement to catch ios_base: : failure, and output 0 for the age. Ex: If the input is: Lee 18 Lua 21 Mary Beth 19 Stu 33 1 then the output is: Lee19Lua22Mary0Stu34

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions