Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 math topic arranging to descending
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
x-ecutioner




PostPosted: Fri Mar 27, 2009 9:07 pm   Post subject: math topic arranging to descending

hi guys
im learning scheme
one of the excercises is to:
Define the program convert3. It consumes three digits, starting with the least significant digit, followed by the next most significant one, and so on. The program produces the corresponding number. For example, the expected value of

(convert3 1 2 3)

is 321.

im googling away but any ideas?
bare in mind they waant it algebraically.
i havent learnt anything so far (as in like conditional statements or loops). its actaully the first page on basic constants.

thanks.
Sponsor
Sponsor
Sponsor
sponsor
Prabhakar Ragde




PostPosted: Sat Mar 28, 2009 7:06 am   Post subject: RE:math topic arranging to descending

I'd prefer not to see solutions to HtDP problems posted here, please.

I would also advise you to not Google for answers. The point is not to write down the answer, or to look at a correct answer and understand it. The point is to go through the exercise of figuring out the answer yourself.

In this case, you have to compute the number 321 (three hundred and twenty one) from the individual numbers 1, 2, 3, in a general fashion. So your function will look like

(define (convert3 a b c)
...)

where you fill in the ... with some expression involving a,b,c.

That's not too hard, if you think about it.
x-ecutioner




PostPosted: Sat Mar 28, 2009 10:38 pm   Post subject: RE:math topic arranging to descending

oh i didnt know
im not arguging
but more out of curiousity, why is posting the problem considered objectionable?

ill look into your advice though thanks:)

i tried figuring it out myself for quite some time
i didnt tihnk itd hurt if i got help online and learn from this experience
Tony




PostPosted: Sat Mar 28, 2009 11:53 pm   Post subject: Re: RE:math topic arranging to descending

x-ecutioner @ Sat Mar 28, 2009 10:38 pm wrote:
but more out of curiousity, why is posting the problem considered objectionable?

Posting problems is not objectionable; the solutions are.

Prabhakar Ragde @ Sat Mar 28, 2009 7:06 am wrote:
The point is not to write down the answer, or to look at a correct answer and understand it. The point is to go through the exercise of figuring out the answer yourself.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Prabhakar Ragde




PostPosted: Sun Mar 29, 2009 7:06 am   Post subject: RE:math topic arranging to descending

It's fine to ask for help here.

I just wanted to make it clear (not just to you, but to everyone reading) that the help offered should be in the form of a gentle hint and not a complete solution.

It's typically hard to get gentle hints by Googling, which is why I don't think it's a good idea if the goal is to teach yourself something.
zero-impact




PostPosted: Sun Mar 29, 2009 6:09 pm   Post subject: RE:math topic arranging to descending

Try thinking about the ones column, the tens column etc..
saltpro15




PostPosted: Sun Mar 29, 2009 8:03 pm   Post subject: RE:math topic arranging to descending

quick question : I've heard scheme is taught at the first year of Waterloo CS/SE . Is this correct?
Prabhakar Ragde




PostPosted: Sun Mar 29, 2009 9:38 pm   Post subject: RE:math topic arranging to descending

More so in CS (in fact for everyone in the Faculty of Math). The SE coverage is pretty minimal.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sun Mar 29, 2009 10:15 pm   Post subject: Re: RE:math topic arranging to descending

saltpro15 @ Mon Mar 30, 2009 9:03 am wrote:
quick question : I've heard scheme is taught at the first year of Waterloo CS/SE . Is this correct?


And it's a wonderful thing. Smile
wtd




PostPosted: Sun Mar 29, 2009 10:23 pm   Post subject: Re: RE:math topic arranging to descending

zero-impact @ Mon Mar 30, 2009 7:09 am wrote:
Try thinking about the ones column, the tens column etc..


Listen to this. Zero-impact's giving you good advice.
wtd




PostPosted: Sun Mar 29, 2009 10:24 pm   Post subject: Re: math topic arranging to descending

x-ecutioner @ Sat Mar 28, 2009 10:07 am wrote:
hi guys
i havent learnt anything so far (as in like conditional statements or loops). its actaully the first page on basic constants.


Good. Scheme doesn't have conditional statements or procedural loops.
Prabhakar Ragde




PostPosted: Mon Mar 30, 2009 5:38 am   Post subject: RE:math topic arranging to descending

Don't frighten him.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: