6. Who'er the users?

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/ruby-beginner-en-X5wcR/0/6?curriculum_id=5059f8619189a5000201fbcb

<In what way does your code behave incorrectly? Include ALL error messages.>
Why do I get “Edgar”=>668 when I entered 01234?

``` my_computer = Computer.new("Edgar", 01234) your_computer = Computer.new("Michael", 56789)

my_computer.create(“films.txt”)
your_computer.create(“cars.txt”)

puts “Users: #{Computer.get_users}”

<do not remove the three backticks above>

Here’s a hint:

irb(main):001:0> 100
=> 100
irb(main):002:0> 0100
=> 64
irb(main):003:0> 0b100
=> 4
irb(main):004:0> 0x100
=> 256

Oh dear, must read up about that. Have not met it before :open_mouth:

Our culture represents numbers with 10 symbols. That is arbitrary. Computers use two. You were writing a number in octal. Hexadecimal is often used to represent bytes. base64 is sometimes used to store data as printable text much more densely than if using only digits, but still not utilising the full range of a byte which is how much space a character usually takes.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.