1 day only! I will answer your beginner home-work assignments!
-
PLEASE DISREGARD THIS POST - I WAS ONLY JOKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Hmm
Whois Server Version 1.3
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.No match for "PROGRAMMINGHOMEWORK.COM".
It might just work. A mate of mine from university set up www.cheathouse.com[^]. Makes a packet out of it too. Ryan "Everybody has a right to be stupid, but some people abuse the privilege." Uncle Joe Stalin
-
PLEASE DISREGARD THIS POST - I WAS ONLY JOKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Ok, I'll take you up on it. I've *very* new at this and assume the question is trivial, but can't seem to figure out how to get the documentation to tell me what I want to know. I need to read a string and, if it's a number, convert it to double. How do I tell whether the string (input via the Console::ReadLine() method) contains only numeric characters (and can therefor be correctly converted to double via the Convert::ToDouble() method) or not? If this turns out not to be trivial, just let me know and I'll think of something else. Maybe get a stream of chars or something (yuck!)
-
Ok, I'll take you up on it. I've *very* new at this and assume the question is trivial, but can't seem to figure out how to get the documentation to tell me what I want to know. I need to read a string and, if it's a number, convert it to double. How do I tell whether the string (input via the Console::ReadLine() method) contains only numeric characters (and can therefor be correctly converted to double via the Convert::ToDouble() method) or not? If this turns out not to be trivial, just let me know and I'll think of something else. Maybe get a stream of chars or something (yuck!)
Your question sounds like a sincere request for advice - and I would gladly answer it if I could - but I am only familiar with MFC and C++ - I think your question is either .NET, JAVA or C# (I have no idea).
-
PLEASE DISREGARD THIS POST - I WAS ONLY JOKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If you wish to buy some advertising then please contact marketing@codeproject.com. Advertising in this way is, unfortunately, unacceptable. cheers, Chris Maunder
-
Ok, I'll take you up on it. I've *very* new at this and assume the question is trivial, but can't seem to figure out how to get the documentation to tell me what I want to know. I need to read a string and, if it's a number, convert it to double. How do I tell whether the string (input via the Console::ReadLine() method) contains only numeric characters (and can therefor be correctly converted to double via the Convert::ToDouble() method) or not? If this turns out not to be trivial, just let me know and I'll think of something else. Maybe get a stream of chars or something (yuck!)
Even though this isn't C/C++ like Terry said, you can still use this same method that I'd use. Write a function that checks each character to see if it is a number or not. Return true if its a number and false if not. If it reaches the end of the string without returning false, then it converts it double, else it fails. Two ways I can think of to do this. One is just check the char is equal to any number 0-9 (this probably isn't the most effective way) or convert to ascii and check if it is within the ascii range for a number. Mike
-
If you wish to buy some advertising then please contact marketing@codeproject.com. Advertising in this way is, unfortunately, unacceptable. cheers, Chris Maunder
Code-Project would accept sponsors whose product was selling homework completion for students?!?!?!?!? :) :) I guess so, or you wouldn't have referred my joke to your ad dept - or was that in itself a joke??!??! I am so confused! Anyways, I was just joking. Have a cheerful day!
-
Hmm
Whois Server Version 1.3
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.No match for "PROGRAMMINGHOMEWORK.COM".
It might just work. A mate of mine from university set up www.cheathouse.com[^]. Makes a packet out of it too. Ryan "Everybody has a right to be stupid, but some people abuse the privilege." Uncle Joe Stalin
I was just kidding. Maybe someone would be willing to put something together to make some $$$.
-
Your question sounds like a sincere request for advice - and I would gladly answer it if I could - but I am only familiar with MFC and C++ - I think your question is either .NET, JAVA or C# (I have no idea).
Terry O`Nolley wrote: but I am only familiar with MFC and C++ - I think your question is either .NET, JAVA or C# (I have no idea). No...it's C++ with managed extensions :)
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?" -Hockey on being a geek
-
Ok, I'll take you up on it. I've *very* new at this and assume the question is trivial, but can't seem to figure out how to get the documentation to tell me what I want to know. I need to read a string and, if it's a number, convert it to double. How do I tell whether the string (input via the Console::ReadLine() method) contains only numeric characters (and can therefor be correctly converted to double via the Convert::ToDouble() method) or not? If this turns out not to be trivial, just let me know and I'll think of something else. Maybe get a stream of chars or something (yuck!)
You could look at the System::Text::RegularExpressions namespace and create a regular expression that would match the characters 0-9...then check to see if the thing is a match. You could also use the Microsoft::VisualBasic namespace X| and the IsNumeric() function. Also, I think the Convert::ToDouble() throws an exception if the input string is not in a proper format. (Actually I know so, I just did this the other day in C#). You could wrap the call to ToDouble() in a try catch block and handle the error whichever way you want. Hope that helps... :)
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?" -Hockey on being a geek
-
PLEASE DISREGARD THIS POST - I WAS ONLY JOKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
What fun!!! :(