Question: Using C++ Write a program that asks the user for two numbers and displays their sum. The program should reject any non-number input. The program

Using C++ Write a program that asks the user for two numbers and displays their sum. The program should reject any non-number input. The program does this by reading the numbers in as C-Strings and then uses the following function to test the input: isNumber() - this function accepts a C-string as it's only argument. The function uses appropriate functions from chapter 10 to determine if the C-string passed to it contains a number. If it does, then it should return true, false otherwise. For example, if the C-string passed to it is "123.45" then the function returns true. If the C-string contains "12g" or "hello", then the function returns false. After the numbers are verified, they will need to be converted to an appropriate data type and then added together. Do not use global variables.

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!