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

Ezzaral commented: This is not your homework completion service. -1

Recommended Answers

All 4 Replies

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

commented: haha well said +3

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

http://www.catb.org/~esr/faqs/smart-questions.html#writewell

> iam on my ilp training so i need tht very urgently
And is your "training" anything to do with learning scheme?
If whoever is paying for this course finds out you're trying to scam free homework, what are they likely to say about it?

Maybe if you posted an attempt, people would be much more willing to help you.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.