0

I have a problem with a lab. I need to write different set of programs with strings. The different things I need to figure out for ouput are the capital letters, what each word starts with, the punctuation, etc. Can anyone at least help me get started?

2
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by Dave Sinkula
0

i think i am starting to get it but I am bit sure how to declare a string

int main ()
{

    string sentence;


cout << "Programmed By: Bryan Kruep \n" <<endl;

    cout << "Enter a sentence: ";
    cin >> sentence;



                return 0;
    }

Edited by mike_2000_17: Fixed formatting

0

Output the characters of the string one at a time, toupper will make each uppercase.

Words are typically whitespace delimited.

0

I am starting to get it but when I run the following info the string variable is only the first word so I must have declared the string sentence wrong and if this doesnt use code tags please let me know so I can make it easier for you guys

int main ()
{

	string sentence;




	cout << "Programmed By: Bryan Kruep \n" <<endl;

	cout << "Enter a sentence: ";
	cin >> sentence;

	cout << endl << "Your sentence is:" << endl << sentence;

	cout << endl << endl << "The capital letters are:";

	cout << endl << endl;

	cout << "Your original sentence was:" << endl << sentence;

	cout << endl << endl;


	



				return 0;
	}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.