Question
Write a function called countChars to: Import an array of Set structs, and the array length; and return nothing. For each Set: Count the number
Write a function called countChars to:
Import an array of Set structs, and the array length; and return nothing.
For each Set:
Count the number of occurrences of the search character within the word string. (Count exact matches only. Uppercase and lowercase letters are different.) Calculate the proportion (i.e. a real number between 0 and 1) of the characters in word that match search.
Output the count and proportion on a single line, separated by a space. The proportion should be expressed with 3 decimal places. For example: 0 0.000 2 0.250 1 0.167 1 0.143 (This is the expected output given the example input file shown previously.)
Return nothing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started