Thith Meanth War!

I  Thtrings & Things

i. What you’ll be building 1/8

Save and Submit

ii. Getting User Input 2/8

print "What's your favorite fruit?"
user_input = gets.chomp

iii. Downcase!  3/8

print "What's your favorite fruit?"
user_input = gets.chomp
user_input.downcase!

iv. Setting Up the ‘If’ Branch, Part 1 4/8

print "What's your favorite fruit?"
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s" 
 print"YES S"
end

v. Setting Up the ‘If’ Branch, Part 2 5/8

print "What's your favorite fruit?"
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s" 
 user_input.gsub!(/s/, "th")
end

vi. Formatting with String Methods 6/8

Setting Up the 'Else' Branch

vii. Returning the Final String—Er, “Thtring” 7/8

print "What's your favorite fruit?"
user_input = gets.chomp
user_input.downcase!
puts user_input

if user_input.include? "s" 
    user_input.gsub!(/s/, "th")
else 
    print "There is no s"
end

viii. Congratulationth! 8/8

Save and Submit!

Advertisements

One thought on “Thith Meanth War!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s