SCT Error : 5. Getting more creative

<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.>
Exercise link

<In what way does your code behave incorrectly? Include ALL error messages.>

Hi everyone,

I’ve checked my code several times and visited the forums but haven’t found a solution to my problem. I keep getting an SCT Error with the following code. Can anyone help ? Thanks.

```

class Computer
@@users = {}

def initialize(username,password)
@username = username
@password = password
@files = {}
@@user[username] = password
end

def create(filename)
time = Time.now
@files[filename] = time
puts “#{filename} was created by #{@username} at
#{time}.”
end

end

<do not remove the three backticks above>

My code is the same, the exact same as yours, minus the puts statement and I am getting the same thing. I have tried searching the forums as well, and no luck. I too, get an SCT error and for the life of me I cannot figure out why. I have also refreshed the page and reset the code, with no luck at that also.

It seems there’s a bug with the code checker. I copy-pasted the code from Section 1 and it still gives me an SCT error. I sent a bug report to Codecademy, but it’d be great if a dev could get back to us on this.

@dfc3021 I reset the exercise and started from scratch and it worked ! My code changed as well, so I’m not sure why it’s working now. Here’s my code, just in case:

class Computer
  @@users = {}
  def initialize(username, password)
    @username = username
    @password = password
    @files = {}
    @@users[username] = password
  end
  def create(filename)
    time = Time.now
    @files[filename] = time
    puts "#{@username} has created #{filename} at #{time}!"
  end
end
2 Likes

crazy dude! I tried it again and it wouldnt pass so I copied your code and it did, funny thing is, here is my code compared to yours and I cant figure out whats different lol

class Computer
  @@users = {}
  def initialize(username, password)
    @username = username
    @password = password
    @files = {}
    @@users[username] = password
  end
  def create(filename)
    time = Time.now
    @files[filename] = time
    puts "#{@filename} has been created at #{time} by #{username}."
  end
end

haha but thank-you though i passed now! appreciate your help

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