This is what I have to do
Write a console-based program that accepts a user's
message and determines whether it is short enough for
a social networking service that does not accept messages
of more than 140 characters. Save the program as
Twitter.cs.
This is what i have done
double maxLimit = 140;
double userInPut;
string stringUserInPut;
Console.WriteLine("Enter your message, but remember the text cannot exceed 140 characters");
stringUserInPut = Console.ReadLine();
userInPut = Convert.ToDouble(stringUserInPut);
if (userInPut > maxLimit)
Console.WriteLine(" The message is too long , sorry");
else
Console.WriteLine(" Your message is sent");
My questions are, how can I allow any characters to be typed in,such as numbers, symbols , etc, with double I can only do numbers and if I do letters it gives a me an error. also in the problem they ask me to " not accept the message if its over 140 characters" when in my version it shows message.
Loading
Sam HobbsPosted Dec 30, 2011, 4:44 AM
Prime bPosted Dec 30, 2011, 4:13 AM
Sam HobbsPosted Dec 30, 2011, 3:11 AM
I said "use the Length property of a string". That is how you solve this latest problem.
Prime bPosted Dec 30, 2011, 2:36 AM
What should I do?
Sam HobbsPosted Dec 30, 2011, 12:50 AM
Prime bPosted Dec 29, 2011, 8:15 PM
Sam HobbsPosted Dec 29, 2011, 7:43 PM