Lesson lets me pass but something is wrong with State string not sure what?


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-MxXx5/0/6?curriculum_id=5059f8619189a5000201fbcb


First off I am confused how this lesson is different from the last both this and the last allowed me to pass while giving me an error "uninitialized constant Context::Nebraska" for when I put in the state. It did this for the previous lesson and this one. It seems as though I am doing everything right until I get to the state part. My other question is I notice that the ! mark is used after .capitalize and .upcase when previous lessons told us it was not mandatory. Sorry for all the questions in one post.


Replace this line with your code. 
print "What's your first name?"
first_name=gets.chomp
.capitalize
print "What's your last name?"
last_name=gets.chomp
.capitalize
print "What city are you from?"
city=gets.chomp
.capitalize
print "What state are you from?"
state=gets.chomp
.upcase
first_name="Mike"
puts"Your name is #{first_name}!"
last_name="Azimi"
puts"Your last name is #{last_name}!"
city="Omaha"
puts"Your city is #{city}!"
state=Nebraska
puts"Your state is #{state}!"
print"What is your first name?"
answer=gets.chomp
answer2=answer.capitalize
answer.capitalize!
print"what is your last name?"
answer=gets.chomp
answer2=answer.capitalize
answer.capitalize!
print"What city are you from?"
answer=gets.chomp
answer2=answer.capitalize
answer.capitalize!
print"What state are you from?"
answer=gets.chomp
answer2=amswer.upcase
answer.upcase!


#2

If your code crashes then you should fix that unless instructions explicitly say that it should crash.

Methods ending in ! modify (mutate) the value that they are called on, you can read what String's capitalize and capitalize! methods do at:
http://ruby-doc.org/core-2.2.0/String.html#method-i-capitalize


#3

This is in the form of a variable identifier, when it should be a string...

state = "Nebraska"

This is moot though, since it is not what is asked for in the instructions.


#4

Thank you I will be a pest to you guys for awhile this stuff is difficult to learn on my own with no coding experience.


#5

Take your time and look up as many examples as you can for each new concept.. Practice, practice, practice.

Sketching a problem ahead of time lets us get a better picture of what steps we will be taking and what data types we'll be using. The most common are numbers, strings (text) and booleans (true and false). Recognizing the correct usage first takes learning the correct usage.

"this is a string" => data type, 'string'
rand(a..b)         => data type, 'number'
if a > b           => data type, 'boolean'

Text that is not delimited with quotes, either single or double (matching) are treated as identifiers by Ruby. Variables are identifiers.

edit: messed up...