Congratulations on making it to the end of this course! It's time put your newfound knowledge to the test by completing a coding exercise. You'll complete this lesson using the Learn IDE - click the "Open in IDE" button and write your code in the app.rb
file.
- Create a local variable called
name
and set it equal to a string of your name. - Create a local variable called
age
and set it equal to an integer of your age. - Create a local variable called
favorite_food
and set it equal to a string of your favorite food. - Create a local variable called
height_in_inches
and set it equal to an integer of your height in inches. (HINT: If you're 7 feet tall, this should be 84) - Create a variable caleld
height_message
using the ternary operator. If your height in inches is greater than average, the message should say "You are taller than average." Otherwise, it should say "You are not taller than average."
When you're done, you can test your code by running ruby app.rb
from the provided Terminal. You should see an output message from the computer. Then complete the official grading tests by typing learn test
. Once you get all tests passing, you can then submit the lab by running learn submit
from the Terminal. Good luck!