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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
You know the right answer?
Given an alphanumeric string made up of digits and lower case ASCII characters only, find the sum of...
Questions