|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 | |
|
Member (4 bit)
Join Date: Aug 2007
Posts: 9
|
c++: Questions regarding strings and cases
In my entry-level computer science course, the professor wants us to write a little program that will classify a message as spam or not. Some of the instructions that are giving me trouble are the following:
1. "Enter the body of the email. Press enter on an empty line to finish." I don't understand how to do this. To make myself clear here, I mean that the user has to press Enter on an empty line in order to finish writing the body part. Example: Quote:
More questions to come soon :x Thanks in advance. |
|
|
|
|
|
|
#2 |
|
Moderator
Staff
Premium Member
Join Date: Aug 2003
Location: Richmond, VA
Posts: 7,835
|
Firstly, can't you simply put an endline after the cout statement in order to start from the next line, when you cin?
Secondly, think ASCII. Each letter, upper case, lower case, etc., corresponds to a value. If the value of the letter in any string is above a certain number, then the letter is upper case. kram
__________________
"For today, goodbye. For tomorrow, good luck. And forever, Go Blue!"
University of Michigan President Mary Sue Coleman |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|