Hello, I am fairly new to c++ and I am wanting to find out some information about creating a calculator that can calculate a noisy input stream e.g.

1hgj6-fgkj7 = 14 (1+6+7)

3ku5jf3 = 11 (3+5+3)

I have looked into some tutorials when creating a calculator in C++, although none of them give reference to calculating a noisy input stream.

Any help on this issue would be greatly appreciated :)

Regards, Nick.

Recommended Answers

All 5 Replies

What do you mean by noisy input stream?

For example calculating a sum of numbers e.g. 2, 4, 7, while they are in surrounded by letters and non numerical characters. So in effect just add the numbers up and ignore the other characters.

Hello, thank you for your input, although how would you implement some kind of caluculation into the code, as far as I can see it only distingushes a letter from and number. Although this is very usefull I am unable to implement it into a calculator.

Kind Regards.

Treat everything for which isdigit() is false as a space, and sum whatever remains?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.