Computer Science Canada

Help me with this program please.

Author:  Brainyprogrammer [ Thu Jan 14, 2010 1:28 am ]
Post subject:  Help me with this program please.

Hie! guyzz I dunno whether I POSTED IT ON THE RIGHT FORUM R NOT? kINDLY help me to this one.well,
Write a program to output the first and last letters of a word entered by the user. If the word entered is less than two characters, output the error message ?The word entered has only 1 character.? Use a loop in your program to allow the user to run it continuously until they enter the sentinel ?exit?.

hELP ME TO DO THIS PROGRAM

Author:  Turing_Gamer [ Thu Jan 14, 2010 8:24 am ]
Post subject:  Re: Help me with this program please.

Ya try and post it on the help forum.
BTW, we can't make the program for you but we can guide you.

As for helping you, I don't know every command so it is out of my hands. Counting letters in a word is hard.
Error message is easy
Turing:
var lettercount : int
var word : string

loop
    get word
    %Some program to count letters
    if lettercount <= 1 then
        put "Error, not enough letters"
    end if
end loop

Author:  registration [ Fri Jan 15, 2010 1:25 pm ]
Post subject:  Re: Help me with this program please.

Turing_Gamer @ Thu Jan 14, 2010 8:24 am wrote:
Ya try and post it on the help forum.
BTW, we can't make the program for you but we can guide you.

As for helping you, I don't know every command so it is out of my hands. Counting letters in a word is hard.
Error message is easy
Turing:
var lettercount : int
var word : string

loop
    get word
    %Some program to count letters
    if lettercount <= 1 then
        put "Error, not enough letters"
    end if
end loop


It's not hard, rather very easy.
Turing:

var word : string
loop
get word
exit when length (word) >2
put "Error message"
end loop

I don't remember correctly if length was the correct command, but please do check turing docs.[/i]

Author:  Turing_Gamer [ Sun Jan 17, 2010 3:12 pm ]
Post subject:  Re: Help me with this program please.

Oh I didn't know that command. Guess I learned something.


: