Check out example codes for "write a program that accepts a sentence and calculate the number of letters and digits". It will help you in understanding the concepts better.

Code Example 1

how to write a program that accepts a sentence and calculate the number of letters

Learn ReactJs, React Native from akashmittal.com