subject

In c++ please 12.5 LAB: Exception handling to detect input string vs. int
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:
Lee 19
Lua 22
Mary 0
Stu 34

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
You know the right answer?
In c++ please 12.5 LAB: Exception handling to detect input string vs. int
The given program r...
Questions
question
History, 06.03.2020 06:16
question
Mathematics, 06.03.2020 06:17
question
Mathematics, 06.03.2020 06:18
Questions on the website: 13722361