Re: need some help with writing a basic program

2011-09-12 Thread Rob Dixon
On 12/09/2011 20:47, Ryan Munson wrote: The full exercise states: Write a program that asks for a decimal number less than 256 and converts it to binary. (Hint: You may want to use the bitwise and operator 8 times.) Since 256 is 2^8, I am assuming using a computation of 2**8 is involved. You

Re: need some help with writing a basic program

2011-09-12 Thread Jim Gibson
On 9/12/11 Mon Sep 12, 2011 12:47 PM, "Ryan Munson" scribbled: > The full exercise states: > > Write a program that asks for a decimal number less than 256 and converts > it to binary. (Hint: You may want to use the bitwise and operator 8 times.) > > Since 256 is 2^8, I am assuming using a co

Re: need some help with writing a basic program

2011-09-12 Thread Brandon McCaig
On Mon, Sep 12, 2011 at 3:47 PM, Ryan Munson wrote: > it to binary. (Hint: You may want to use the bitwise and operator 8 times.) > > Since 256 is 2^8, I am assuming using a computation of 2**8 is involved. The answer is in the hint. What does the bitwise-and operator give you? See perldoc perlop

Re: need some help with writing a basic program

2011-09-12 Thread Ryan Munson
The full exercise states: Write a program that asks for a decimal number less than 256 and converts it to binary. (Hint: You may want to use the bitwise and operator 8 times.) Since 256 is 2^8, I am assuming using a computation of 2**8 is involved. Ryan On 9/12/11 3:29 PM, "Brandon McCaig"

Re: need some help with writing a basic program

2011-09-12 Thread Brandon McCaig
On Mon, Sep 12, 2011 at 2:55 PM, Ryan Munson wrote: > I am running through a good book on Perl and am having some issues with a > script I am trying to create for one of the practice exercises (I am > teaching myself Perl for work). Just to let you know the solution does not > involve using an if

Re: need some help with writing a basic program

2011-09-12 Thread Ryan Munson
I could, but the book also mentions a hint to using the bitwise operator. Loops are still to come. =) Ryan From: Hal Wigoda Date: Mon, 12 Sep 2011 14:07:18 -0500 To: Ryan Munson Subject: Re: need some help with writing a basic program Use a while or for loop On Sep 12, 2011 1:58 PM