By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,134 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,134 IT Pros & Developers. It's quick & easy.

program that corrects syntax errors in english

P: 43
I need some serious help...I got the first part of the program done the accountant part but i can't figure out how to do the checker..i have been trying for hours and nothings workin any help or reccomendations woulde be greatly appreciated...

1. Accountant. Write a program that accepts a sequence of integers (some of which may repeat) as input
and prints every integer exactly once. You can assume that there are no more than 20 integers in the input.
But there may be less. Zero signifies the end of input. It should NOT be printed.

For example, when the following input is provided to your program:

5 6 22 5 22 7 6 0

your program should print:

5 6 22 7

You must use an array to store the numbers input.
Place your program in a single file called: accountant.cpp




2. Checker. Write a program that reads English text. The program should output the text with spacing
corrected and with letters corrected for capitalization. In particular, in the output text all strings of two or
more blank spaces should be compressed to a single blank. A sentence (a letter starting the text and
following a dot) should start with an uppercase letter. There should be a space after a comma or a dot. No
other formatting is required.

For example, the input:

the Answer to life,the Universe, and everything is 42.

Should produce the following output:

The answer to life, the universe, and everything is 42.

Empty line signifies the end of input. This empty line should NOT be output.
You should use a C++ string to store a line of input.
Place your program in a single file called: checker.cpp
Nov 2 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.