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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!