b) Write a function called digit sum(string s), where s is a string, representing the file name ”data.txt” when the function is called in the main function. The function digit sum returns the sum of...

b) Write a function called digit sum(string s), where s is a string, representing the file name ”data.txt”
when the function is called in the main function. The function digit sum returns the sum of all the single
digits contained in the file ”data.txt” as an integer (type). [10 Points]
c) Write a function called digit count(string s), where s is a string, representing the file name ”data.txt”
when the function is called in the main function. The function digit count returns the count (number of
all single digits) contained in the file ”data.txt” as an integer (type). [10 Points]
d) Write a function called letter count(string s), where s is a string, representing the file name ”data.txt”
when the function is called in the main function. The function letter count returns the the count (number
of all letter) contained in the file ”data.txt” as an integer (type). [10 Points]
e) Write a function called digit percent(string s), where s is a string, representing the file name ”data.txt”
when the function is called in the main function. The function digit percent computes the percent value
of how many characters in the file ”data.txt” are digits, and returns that percent value as a double (type).
[10 Points]

Sep 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here