- Joined
- Jan 17, 2004
If your looking for something to do I have just the thing for you !!
C++ conversion
prototype:
string CommaConvert(string prompt){return string};
1. write a function that takes a string
2. detect commas only and remove them
3. shift string char's into proper location after removal of comma
if you had a string of 1,552,300.85 then you would want to end up with 1552300.85
initial string size of 12 would change to size of 10
4. return string
//////////////////////// if your really awesome
prototype:
string CommaConvert(string prompt){return string};
add a bool value to function to set if error is displayed
1. detect if commas are out of order and display error
example error output for 12,8.95
1200.8,4
12,,98.51
etc ...
this is not a requirement for my project but Im trying to go the extra mile with input validation .. I will likely use it if it works and will cite your work for appropriate credit ..
also this is mainly for a function i started working on to convert a string represented double to a double double (no pun intended ) .. likely people will will re-use this ... so if your not into sharing your skills then thanks for reading
just has to work error free how ever you get there ... ill be working slowly in the backgrounds too
C++ conversion
prototype:
string CommaConvert(string prompt){return string};
1. write a function that takes a string
2. detect commas only and remove them
3. shift string char's into proper location after removal of comma
if you had a string of 1,552,300.85 then you would want to end up with 1552300.85
initial string size of 12 would change to size of 10
4. return string
//////////////////////// if your really awesome
prototype:
string CommaConvert(string prompt){return string};
add a bool value to function to set if error is displayed
1. detect if commas are out of order and display error
example error output for 12,8.95
1200.8,4
12,,98.51
etc ...
this is not a requirement for my project but Im trying to go the extra mile with input validation .. I will likely use it if it works and will cite your work for appropriate credit ..
also this is mainly for a function i started working on to convert a string represented double to a double double (no pun intended ) .. likely people will will re-use this ... so if your not into sharing your skills then thanks for reading
just has to work error free how ever you get there ... ill be working slowly in the backgrounds too