Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will extract two numbers (type double) from a sentence and then add them. You can set the sentence as a string

Write a program that will extract two numbers (type double) from a sentence and then add them. You can set the sentence as a string constant or you can enter it from the keyboard. The sentence can contain any number of words but it will only have two ream numbers. Find the two numbers and add them.

EXAMPLE: Suppose the string entered (or constant) is The sum of 25.25 and 13.50 is.

The program should print to the screen: 25.25 plus 13.50 is 38.75.

NOTE: The two numbers can be any value. Dont hard code to the values shown in the example.

// C++ Template

#include #include #include #include

using namespace std;

int main(void)

{

cout << endl << endl; system("pause");

return 0;

}

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 Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

What is the logic for a seller to offer a discount?

Answered: 1 week ago

Question

Have a brief review of human motivation theories

Answered: 1 week ago