Read both part Q4a Q4b and Q4c before attempting the question You can submit part Q4a

(5 customer reviews)

Original price was: $10.00.Current price is: $5.00.

Download button will appear immediately after successful payment.

Full support will be provided with necessary files installation.

Get impeccable customized solution within 24 hours, hassle-free.

View Details
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.


Read both part Q4(a), Q4(b), and Q4(c) before attempting the question. You can submit part Q4(a), Q4(b), and Q4(c) together.

Question 4a

Create and write a function countRepeatingChar(word: string): int, that returns the highest number of the “repeating letter” in the given parameter word. Assume the given parameter word is in lowercase. For example, countRepeatingChar(word) returns these values for the following words as parameters:

– assistants 4

– that 2

– business 3

– count 1

Write a function initializeDictionary(filename: string): dictionary, that reads the words from the given filename and returns the dictionary in the following format:


The key is the number of the “repeating letters”, and the value is a list of words. Content of the file will be words separated by space. Each line may contain one or more words (all in lowercase). Example of a sample input file content:

For each of the word read, find the highest number of the “repeating letter” for this word. Use this number as the key to the dictionary, to either build the list or append the word into the list. (13 marks)

Create and implement a main function that calls the initializeDictionary function, and write selected content of the dictionary into another file, in this order and format:

– ignore words that have no repeating letter, i.e., those words with key = 1

– in ascending order of the number of “repeating letters”, followed by the list of words that have this number of repeating letters

Sample output file:

2: that function repeating letters

3: repeated suss business assist

4: assistants (9 marks)

5 reviews for Read both part Q4a Q4b and Q4c before attempting the question You can submit part Q4a

  1. Christina Martini

    Tutor wrote it quickly and effectively. Great solution.

  2. Caroline Riberdy

    Second time coming to this website for a paper and it worked out great.

  3. John Chaple

    Thanks a lots, I really appreciate your effort it is an excellent report.

  4. Mike Slaughter

    Tutor is patient, highly efficient and well spoken. I can always count on early delivery! Thx!!

  5. Stephanie Specht

    It was quality work and in a timely manner. It was the help I needed at the time, and I appreciate it so very much.

Only logged in customers who have purchased this product may leave a review.

You may also like…

Patron Details

Additional information

Your Solution

Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.