Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Ward van Wanrooij <ward@ward.nu>
Subject: Re: help!
Date: 2000/03/26	[thread overview]
Message-ID: <38DE18D0.1D308E8@ward.nu> (raw)
In-Reply-To: 954077449.187288@mx4.ix.net.nz

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



  reply	other threads:[~2000-03-26  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-27  5:00 help! Lutfor Rahman
2000-03-26  5:00 ` Ward van Wanrooij [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-09-12  4:00 HELP!! CNRS DeA Research
1998-06-22  4:00 Help? Joaquin Serna
1998-06-23  4:00 ` Help? His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox