Bug In The System


#1

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

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

```

It Works like it should, it even gave me credit, but when I put this code in:

print "What’s your first name? "
first_name = gets.chomp

print "What’s your last name? "
last_name = gets.chomp

print "What city are you from? "
city = gets.chomp

print "What state or province are you from? "
state = gets.chomp

puts “Your name is #{first_name.capitalize!} #{last_name.capitalize!} and you’re from #{city.capitalize!}, #{state.upcase!}!”

it gives me this:

What’s your first name? Donald
What’s your last name? Trump
What city are you from? Dunno
What state or province are you from? USA
Your name is and you’re from , !

-Btw, the name “Donald Trump” is a example.

<do not remove the three backticks above>

#2

If you hand .capitalize! (with an exclamation) something that is already capitalized, it will return NIL.

99.99997% of the time it is not “the system”


#3

There definitely seems to be a bug in the system. I have been going over 1.4 Repeat for More Input for almost an hour. I could not figure out what was wrong with the code, also reading all the comments in the Forum. After clicking on “Get Code” from CodeAcademy I ended up getting exactly the same code as I had put in, so there was no error in my code , there was a bug in the system. This was the final code:

print "What’s your first name? "
first_name = gets.chomp

print "What’s your last name? "
last_name = gets.chomp

print "What city are you from? "
city = gets.chomp

print "What state or province are you from? "
state = gets.chomp


#4

The problem wasn’t the code or “the system” It was the input you gave it. It expected to get handed something to capitalize, you gave it something already capitalized so it spat back out nothing.


#5

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