nick34992
5/21/2016 - 8:10 PM

Format Entries - Ruby

Format Entries - Ruby

print "Enter First Name: "
first_name = gets.chomp
first_name.capitalize!

print "Enter Last Name: "
last_name = gets.chomp
last_name.capitalize!

print "Enter City: "
city = gets.chomp
city.capitalize!

print "Enter State: "
state = gets.chomp
state.upcase!

puts "Your name is #{first_name}, your last name is #{last_name}, you're from #{city}, #{state}!"
print "Enter an Interger: "
anInt = Integer(gets.chomp)

if anInt < 0
  puts "#{anInt} is a negative integer!"
elsif anInt > 0
  puts "#{anInt} is a positive integer!"
else
  puts "#{anInt}, also known as ZERO!"
end