-1

Write a program that will read in a number from 0 to 9 and spell out that number. The program must also
report any values that are out of range.In other words, for an input say 2, output should be two

Votes + Comments
This is not your homework completion service.
4
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by sarehu
1

Write a program that will read in a number from 0 to 9 and spell out that number. The program must also
report any values that are out of range.In other words, for an input say 2, output should be two

SIR YES SIR!

its very urgent

Oh dear, I'll get programming right away. To bad I don't know in what language this groundbreaking program should be written. So here's a program to get you started in brainfsck:

++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++.-.---------.

output: one Now on a serious note:
Read the rules
- do not post things like "it's urgent"
- tell us in what language this should be written
- you won't get free homework here, so some effort first

Repost when you've read the rules

[edit] Aha, I see you want it in scheme, so my example wont help you much ;) Still: read the rules and post your effort

Votes + Comments
haha well said
0

thanx for suggestion dude
but i need tht program
iam trying it in many ways
is any one there who is a programmer of dr scheme language
iam on my ilp training so i need tht very urgently

0

So here's a program to get you started in brainfsck:

++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++.-.---------.

output: one

Oh please, that is such a lame solution :) Here's a better (partial) solution.

++++[>++++[>+++++++>++++++<<-]<-]>>-.-.>+++++.

And here is an attempt at a real solution.

++++[>++++[>++++++>+++++++>+++<<<-]<-]
>>+++++>>>,<[->-<]+>
[-[-[-[-[-[-[-[-[-[<->[-]]
<[<--.<++++.>.<----.>>-]>]
<[<<.++++.--.+.>++++.>-]>]
<[<+++.<.>+++.<.>--------.>-]>]
<[<+++.<++++.>+++++.>-]>]
<[<<+.+++.>++++++.<----.>>-]>]
<[<<+.>-.++++++.---.>-]>]
<[<++++.<+++.>--.<---..>>-]>]
<[<++++.+++.--------.>-]>]
<[<-.-.<.>>-]>]
<[<++++++++++.<.>--------.---.>->]

It's totally untested so see if it works.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.