Question: Program 3. Extract and Add a Series of Numbers: Write a program that will extract a series of numbers (type double) from an input sentence

Program 3. Extract and Add a Series of Numbers: Write a program that will extract a series of numbers (type double) from an input sentence and then add them. EXAMPLE: Suppose the sentence entered is Give me the sum of 25.25 and 13.50. The program should print to the screen: The sum = 38.75 NOTE: The numbers can be of any value. Dont hard code to the values shown in the example. In this problem take advantage of the input options presented in class. Particularly cin, cin.get, cin.ignore, and peek. The functions in Appendix C.2 may also be helpful.

please do this in C++

Test Output:

TEST CASE 1. Please tell me the sum of 18.0 plus 25.5. OUTPUT: "The sum is 43.5 TEST CASE 2. If I add 24.5, 18.0 and 17.2 what do I get? OUTPUT: "The sum is 59.7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!