SumOfDigits Raptor Solution

Sum of Digits in a String Design a program that asks the user to enter a string containing a series of single digit numbers with nothing seperating them. The program should display the sum of all the single digit numbers in the string. For example, if
the user enters 2514 the method should return 12. the string to integer library function can be used to convert a single character to an integer.I would recommend putting a character like 'a' somewhere in your input value so Raptor will treat the input as
a String data type. The program should be designed in such a way that it will ignore any non-numeric characters in the input string.

Powered by