Unless? no.5


#1

How do you do this question?


#2

nevermind, all sorted out :smile:


#3

how did you do it im stuck


#4

Cant sort it out as well


#5

The original code looks like this

hungry = false

___ ___
  puts "I'm writing Ruby programs!"
___
  puts "Time to eat!"
___

Basically we have to fill in the blanks. unless is used to check if something is false. Here, the variable to be checked is hungry. So the first underline should be erased using back` space and write

unless hungry

The second blank presents an alternate condition if hunger is not found to be false. Therefore, we will use else. So the second blank will look like

else

The last blank is for terminating the unless condition tree. We write end. So final blank
end

Final code should look like this

hungry = false

unless hungry
  puts "I'm writing Ruby programs!"
else
  puts "Time to eat!"
end

I also got stuck here because I didn't remove the underscores. Make sure to remove them!


#6

The original code looks like this

hungry = false


puts "I'm writing Ruby programs!"


puts "Time to eat!"


Basically we have to fill in the blanks. unless is used to check if something is false. Here, the variable to be checked is hungry. So the first underline should be erased using back` space and write

unless hungry

The second blank presents an alternate condition if hunger is not found to be false. Therefore, we will use else. So the second blank will look like

else

The last blank is for terminating the unless condition tree. We write end. So final blank
end

Final code should look like this

hungry = false

unless hungry
puts "I'm writing Ruby programs!"
else
puts "Time to eat!"
end
I also got stuck here because I didn't remove the underscores. Make sure to remove them!


#7

I've done that but still says same
"Oops, try again. Make sure to replace the __s with the correct part of the unless statement! "


#8

nvrm, it's not Unless it's unless without capital -_-