Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 4B (50 points + 5 bonus) Programming in C Implement a program that determines which word length occurs most frequently in a text file.

Problem 4B (50 points + 5 bonus) Programming in C

Implement a program that determines which word length occurs most frequently in a text file. That is, your program should identify the word length such that there are more words of that length than of any other length. For instance, the most frequent word length in the example file is 2; the file includes four words of that length.

Input and output: Your program should input the name of a text file, and print the word length that occurs most frequently in that file, as well as the number of words of that length. The file name is a string, the length of which is between 1 and 60. The file contains between 1 and 1,000 lines, each of which is between 1 and 60 characters long. The characters in the file include letters, spaces, and line breaks. The file does not include digits or punctuation marks, and it also does not include blank lines. A word in that file is any sequence of letters, surrounded by spaces or line breaks. We assume that the file has only one most frequent word length, that is, two different word lengths cannot tie for the greatest number of occurrences.

Example

image text in transcribed

Command Prompt C:Nhonework4b Enter nane of the input file: nessage.txt The nost frequent word length is 2 The nessage includes 4 words of that length C:N>

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

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago