I need a program written in C++ in Visual Studio and I'll need all the files from it.
I either want some help or you to do it. We'll discuss payment if your interested.
I need this:
Write a C++ program to determine how many nonblank characters are in an input sentence/paragraph supplied by the user. You will print the answer on the output screen for the user. The program should not end until the user ends it.
Example in code box.
Code:Welcome to Candy's Character Counter program! This program will allow you to enter any size paragraph and will return the number of characters in that paragraph. You will enter a paragraph and when finished, press enter. (Please expand this!) Do you wish to continue? (y = yes, n = no): y Enter the paragraph - There are literally hundreds of programming languages. The number of nonblank characters is : 48 The number of uppercase characters is: 1 The number of lowercase characters is : 46 Do you wish to continue? (y = yes, n = no): yes <clear screen> Enter the paragraph - Each was developed to solve a particular type of problem. Most traditional languages, such as BASIC, C, COBOL, FORTRAN and Pascal, are considered procedural languages. The number of nonblank characters is : 143 The number of uppercase characters is : 21 The number of lowercase characters is : 115 Do you wish to continue? (y = yes, n = no): I want to! Invalid response. Do you wish to continue? (y = yes, n = no): Again! Invalid response. Do you wish to continue? (y = yes, n = no): YES I DO! <clear screen> Enter the paragraph - The 15 cows jumped over the moon! Yahoo!@#$%&*(){} The number of nonblank characters is : 43 The number of uppercase characters is : 2 The number of lowercase characters is : 27 Do you wish to continue? (y = yes, n = no): NO <clear screen> Thank you for using Candy's Character Counter!
NOTES OF INTEREST:
1. A paragraph is defined when the user presses the enter key. It can be a few words or a few sentences. Your program will begin to count the characters entered when the user presses the enter key. You test for the enter key as '\n' in the input stream.
2. You can use the Word Count feature in Word to test your program for accuracy.
3. To read in one character at a time, use the cin.get(variableName); function. There are additional get functions, such as getchar and gets, but get will give you what you need for this project.
4. When reading in the response to “Do you wish to continue?” Use the cin.get(variableName); to read in the first character and discard the rest (use cin.sync() ). See the C++ Notes on "Correcting Bad Input" in the Lessons tab in Angel for more information. Then test the one character for a y for yes or a n for no. If the user enters anything other than y or n (that includes both uppercase and lowercase), your program should respond with an invalid response. Do not let the program continue until the user responds correctly.
5. The three characters that should not be included in your count is the spacebar character, the tab character and the enter key character. The cin.get will read in a space, tab and the enter key, so you will need to test for these. If it is a space, tab or the enter key, do not count it in your counter. If it is not a space, tab nor the enter key, then increment your counter. To test for a space, use ' ' (single quotes with one space in between). To test for a tab key, use '\t'. To test for the enter key, use '\n'. (Actually the enter key character should be used as a sentinel value in your loop.)
6. A friendly reminder: The <clear screen> command is system("cls"); Please use it to make your program look nice.
Things to do:
1. Add appropriate comments to your program.
2. Use template.cpp as a guide for your comments at the beginning of your program.
3. Don't forget to add the "welcome" statement describing the program purpose to the user.
4. Your project files should be zipped in a file called P5xyz.zip and uploaded to Angel in the correct submission box area.
Results 1 to 10 of 10
Threaded View
- 23 Mar. 2010 09:22pm #1
Global Moderator Literally Hitler
Morbidly Obese
Bird Jesus
- Age
- 35
- Join Date
- Nov. 2009
- Location
- The Land Of Ooo
- Posts
- 8,569
- Reputation
- 711
- LCash
- 20.00
Hey Codemonkies, want to make some Lg?