From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,48d594073256fe4a,start X-Google-Attributes: gid111c93,public From: Ward van Wanrooij Subject: Re: help! Date: 2000/03/26 Message-ID: <38DE18D0.1D308E8@ward.nu>#1/1 X-Deja-AN: 602566851 Content-Transfer-Encoding: 7bit References: <954077449.187288@mx4.ix.net.nz> X-Accept-Language: nl,en X-Server-Date: 26 Mar 2000 14:03:38 GMT Content-Type: text/plain; charset=us-ascii Organization: www.ward.nu Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha It would sorta spoil the fun and educational value to provide the answer, wouldn't it? Lutfor Rahman wrote: > > hi there, > > I need help to solve the following problem: > > 1 > ________________________________________________________________________ > Write an Alpha assembly language program which behaves as below: > 1. Prompts the user for an input string with a message "Please enter a > string:". It should be > assumed that the string contains at least one and at most fifteen > characters. > 2. After accepting an input string from the user, prints out "The output > string is :". Then, > the program should behave as below depending on the input string : > If the input string contains exactly one letter "A", the program converts > all the letters in > the string to capital case letters and prints out the converted string. > In all other cases, the program prints out the characters with even number > index in the > string in reverse order. It should be assumed that the first character in > the string has > index 0, the second character in the string has index 1, the third character > in the string > has index 2 and so on. Therefore, for string "a-z", the index of "a" is 0, > the index of "-" > is 1 and the index of "z" is 2. Hence, the output of the program should be > "za". > 3. Prints out a message "What to do next (continue/stop)?". The user should > reply with > either "continue" or "stop". > 4. Checks the user's reply. When checking the user's reply, the case of the > letters should > be ignored. For example, "ContinUe" should be regarded the same as > "continue". > If the reply is "continue", the program goes to step 1. > If the reply is "stop", the program terminates. > If the reply is neither "continue" nor "stop", the program goes to step 3. > Here is a sample session (with the user's input in italics): > Please enter a string: A90fgk-) > The output string is: A90FGK-) > What to do next (continue/stop)? CONTINue > Please enter a string: ksjair908Akd > The output string is: KSJAIR908AKD > What to do next (continue/stop)? continue > Please enter a string: A8976A-The > output string is: -69A > What to do next (continue/stop)? Continu > What to do next (continue/stop)? Continue > Please enter a string: 13257+A > The output string is: 13257+A > What to do next (continue/stop)? continue > Please enter a string: !-) > The output string is: )! > What to do next (continue/stop)? Stopp > What to do next (continue/stop)? Stop > > thankx