Computer Science Canada Converting or to our help. |
Author: | JR [ Tue Feb 17, 2004 6:37 pm ] | ||
Post subject: | Converting or to our help. | ||
Ok so i was suppose to do a program that reads a word for example color and coverts it into canadain aka colour. now this is my program, but i get one error. when i type "color" it outputs lour. any way to fix that?
|
Author: | Paul [ Tue Feb 17, 2004 6:58 pm ] | ||
Post subject: | |||
uh, I don't get it? what are you trying to do? Use it only on Colour?
|
Author: | JR [ Tue Feb 17, 2004 7:09 pm ] |
Post subject: | |
no i mean you write a word. if that words end with "OR" the program needs to change it to "our". i just made colour as an example |
Author: | Paul [ Tue Feb 17, 2004 7:17 pm ] | ||
Post subject: | |||
oh I see, you'd need something like this then
|
Author: | jonos [ Tue Feb 17, 2004 9:52 pm ] |
Post subject: | |
paulbian got it backwards, this is what it should be: var word: string get word if word ((length(word)-1)..*)="or" then word:= word(1..(length(word)-1))+"ur" end if put word |