subject

Given an alphanumeric string made up of digits and lower case ASCII characters only, find the sum of all the digit characters in the string. The function signature for 'sum Digits' is -

(define sumDigits ...)

1. Constraints -
- Not allowed to use library functions. This means no import statement.
- No loops or list comprehension. The solution must be recursive.
- Do not use length of string in any function.

2. Input to function 'sumDigits -
- An alphanumeric string.

3. Output of function -
-Sum of all the digits in the string.

4. Sample test case
Test case 1
calling sumDigits ab1c2d3e54 outputs 15 = 1 + 2 + 3 + 5 + 4

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:00, kiaunarayne808
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, Metlife
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
image
Computers and Technology, 23.06.2019 01:50, akornegay2
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, shadow6728g
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
You know the right answer?
Given an alphanumeric string made up of digits and lower case ASCII characters only, find the sum of...

Questions in other subjects: