Question: Q. Write a program that detects potentially complicated sentences. The input is a line of text consisting of one sentence. If the line has more

Q. Write a program that detects potentially complicated sentences. The input is a line of text consisting of one sentence. If the line has more than 150 characters(of any kind, including whitespace, punctuation, etc.), output : Long sentence. If the line has more than 2 commas, output : Many Commas. Both messages may be output. If neither is output, the output is: OK.

If the input is:

At the start, of course, the runners line up, ready to run.

then the output is :

Many commas

If the input is :

The car, which was old, still ran fine.

then the output is :

OK

(C++ please.)

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!