Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

he given program reads a list of single-word tirst names and ages (ending with -1), and outputs that list with the age incremented. Ihe rogram

image text in transcribed

he given program reads a list of single-word tirst names and ages (ending with -1), and outputs that list with the age incremented. Ihe rogram 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 tatement to catch ios_base: : failure, and output 0 for the age. x: If the input is: Lee 18 Lua 21 Mary Beth 19 Stu 33 1 hen the output is: Lee 19 Lua 22 Mary 0 Stu 34 he given program reads a list of single-word tirst names and ages (ending with -1), and outputs that list with the age incremented. Ihe rogram 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 tatement to catch ios_base: : failure, and output 0 for the age. x: If the input is: Lee 18 Lua 21 Mary Beth 19 Stu 33 1 hen the output is: Lee 19 Lua 22 Mary 0 Stu 34

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_2

Step: 3

blur-text-image_3

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Conduct an effective performance feedback session. page 360

Answered: 1 week ago