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
- 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?
- 23 Mar. 2010 09:24pm #2
Sounds like someone needs their homework done.
~Fluxo
- 23 Mar. 2010 09:25pm #3
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
- 10.00
- 23 Mar. 2010 09:27pm #4
I understand. Sometimes I can't get my writing even started.
~Fluxo
- 23 Mar. 2010 09:30pm #5
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
- 10.00
Its a f'in bitch. I can't think of any way to count character other than to take user input, store as a string, and then have loop repeatedly check every non black character against every letter twice(upper and lower) and add to a variable. There has to be a shorter and better method.
- 23 Mar. 2010 09:57pm #6
lol. Easy program is easy. I don't know C++ syntax, but I could do it in PHP or JavaScript.
- 23 Mar. 2010 10:00pm #7
Code Monkey get up get coffee
Code Monkey go to job
Code Monkey have boring meeting with boring manager Rob
Rob say Code Monkey very diligent
but his output stink
his code not functional or elegant
what do Code Monkey think
Code Monkey think maybe manager want to write goddamn login page himself
Code Monkey not say it out loud
Code Monkey not crazy just proud
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you
Code Monkey hang around at front desk
tell you sweater look nice
Code Monkey offer buy you soda
bring you cup bring you ice
you say no thank you for the soda cause
soda make you fat
anyway you busy with the telephone
no time for chat
Code Monkey have long walk back to cubicle
he sit down pretend trk
Code Monkey not thinking so straight
Code Monkey not feeling so great
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you a lot
Code Monkey have every reason
to get out this place
Code Monkey just keep on working
to see your soft pretty face
Much rather wake up eat a coffee cake
Take bath, take nap
This job fulfilling in creative way
such a load of crap
Code Monkey think someday he have everything even pretty girl like you
Code Monkey just waiting for now
Code Monkey say someday, somehow
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
with big warm fuzzy secret heart
Code Monkey like you
Code Monkey like you
Disco is neat.
- 23 Mar. 2010 10:12pm #8
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
- 10.00
PHP and C are similar from what I understand.
I found these converters?
BinaryPHP | Get BinaryPHP at SourceForge.net
The PHP to C++ Translation tool
It says there is some tweeking needed afterward some times. I'm pretty sure I'd be able to do that bit...though I'd rather you just tell me how to approach it.
- 24 Mar. 2010 03:23am #9
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
- 10.00
- 24 Mar. 2010 07:07am #10PHP Code:
<?php
$characters = strlen($_POST['input']);
preg_match_all('/\s/', $characters, $spaces);
$spaces = count($spaces) - 1;
$nonblank = $characters - $spaces;
preg_match_all('/[A-Z]/', $characters, $uppercase);
$uppercase = count($uppercase) - 1;
$lowercase = $nonblank - $uppercase;
?>
If you specifically need just spaces, tabs, and enter keys instead of all space characters change \s to [ \n\r\t].