Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C programming code preferably on Visual Studio 2017 (no C++ can be used). Sentence and Word Counter Write a program that reads a

Create a C programming code preferably on Visual Studio 2017 (no C++ can be used). image text in transcribed
Sentence and Word Counter Write a program that reads a text file as input and counts the number of sentences and words. The input to your program should be a user specified text file. In other words, obtain the name of the input file at run tim from the user of the program. Protect your program against crashes that might be caused by a bad file name. A sentence begins with one of the following: '0'..9', 'A'...Z', or 'a"... z. A sentence, once started, ends with the first occurrence of one of the following sequences: 1. A TERMINATOR followed by two spaces 2. A TERMINATOR followed by one space and end-of-line 3. A TERMINATOR followed by end-of-line 4. A TERMINATOR followed by a double quote and a space 5. A TERMINATOR followed by a double quote and an end-of-line TERMINATORS:. '(period) '?' (question mark) "'(exclamation point) A word begins with one of the same set of characters that begin a sentence. A word, once started, ends with the first occurrence of a space, a tab, or an end-of-line, unless the end-of-line is preceded by a hyphen. Appropriate counting actions should be taken when the end-of-file (EOF) is encountered. The output total number of sentences and words should be printed to the screen. TIPS: Make two passes through the input file. Count the sentences on one pass, words on the other While a good programming practice, functions are NOT required so keep the entire program in the main function. Implement the word counter first because it is, arguably, the easier than the sentence counter MOST IMPORTANTLY, focus on your algorithm before you implement it with code. You've been warned

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_2

Step: 3

blur-text-image_3

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

Students also viewed these Databases questions

Question

3 How the market system answers four fundamental questions.

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago