Write a program that reads characters from the keyboard until a period is received. Have the
program count the number of spaces. Report the total at the end of the program.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jan 27, 2012, 4:40 AM
This should work:
Posted Jan 27, 2012, 4:02 PM
VulpesPosted Jan 27, 2012, 3:51 PM
It's counting the number of spaces entered which is what the question asked.
Posted Jan 27, 2012, 2:49 PM
Please write as much as you want, when you finish type '.'.
#@$%%#%%#$#@#egetretergdfgdfgsdgsdg.
You entered 0 space(s)
Prime bPosted Jan 26, 2012, 8:59 PM
string ch = ".";
Console.Write("Please write as much as you want, when you finish type '.'.");
string input = Convert.ToString(Console.Read());
while (ch != input)
{
for (int index = 0; ; index++)
{
Console.WriteLine("You have typed {0} characters", input.LongCount<);
}
}