Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Number converter
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tubs




PostPosted: Wed Feb 18, 2004 11:13 am   Post subject: Number converter

i am making a number converter... using roman numeral and arabic numbers. i have the arabic to RN part of it done, but the for statement im using for the RN to arabic keeps going out of the array substring. (using i + 1 to check for stuff like IV). is there any way to make a default if or something to tell the program to end the loop if i + 1 is undeclared?


ass4 un3.t
 Description:
number converter

Download
 Filename:  ass4 un3.t
 Filesize:  4.09 KB
 Downloaded:  298 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Feb 18, 2004 6:03 pm   Post subject: (No subject)

you can add a flag character at the end of the string... something like space for example...
code:

text := text + " "


then in your forloop when checking for post characters, if its is your flag character (in this case space) then you know its the end of the string
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tubs




PostPosted: Thu Feb 19, 2004 10:42 am   Post subject: (No subject)

ya man that works, thanks a lot
the_short1




PostPosted: Mon Feb 23, 2004 9:51 pm   Post subject: (No subject)

hmmm... i was kinda thinking of making a Roman Number converter to normal number and back... but ive had no time... plus i found it difficault.. and LOTs of lines of code..


if normal >=1000 and normal <1900 then
roman := roman + "M"
normal := normal - 1000
end if
if normal >=500 and normal <900 then
roman := roman + "D"
normal := normal - 500
end if
if normal >=100 and normal <400 then
roman := roman + "C"
normal := normal - 100
end if
............................... how many lines of code u go so far??

i think by the time i finished mine it mite be like.... i dont know ...500 lines...
.hack




PostPosted: Tue Feb 24, 2004 9:41 am   Post subject: (No subject)

All Three of us should get together and make one huge convertor. I can do some GUI Very Happy
Tubs




PostPosted: Tue Feb 24, 2004 10:57 am   Post subject: (No subject)

OMGZ Liek! OK! i dont care. use the finished thing if you want... it works in almost every case and converts to and from RN


ass4 un3.t
 Description:
This is it.

Download
 Filename:  ass4 un3.t
 Filesize:  6.72 KB
 Downloaded:  232 Time(s)

the_short1




PostPosted: Tue Feb 24, 2004 4:35 pm   Post subject: (No subject)

wuts ur problem TUBS???
.hack thats a good idea...but i dont know..

3 different systems... kinda hard to integrate..

plus... might conflict on whoes BASE to use??? mine,urs,tubS??
GRanted... mine not NEAT yet...have to work on PAc Man v4right now,.,.,.,,, maybe on the weekend i will do unitconverter... wit you all...

Idea BRIGHT IDEA!!!!
to not spam..........
What is each of your email addy's... if you get a MSN Passport...
and then we can have a discusion,.,,,mine is shortbutstrong@hotmail.com

add me and we can discuss possible options to make an ALL in ONE...
but have to week on weekend...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: