Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions