Episode 10 - Naming Variables

Exercises

  1. Write a program that asks the user for their name. For example, if they enter "Suzie" the program should respond with "Hey, Suzie!". If they enter "Peter", the program should respond with "Hey, Peter!".
  2. Update your program so it with a capitalized name, regardless of how the user entered it. For example, if they enter "karen", the program should respond with "Hey, Karen!".
  3. BEST PRACTICES: Look at this code:
    a = "Masha"
    b = "Antonovich"
    c = "37"
    puts "Your name is " + a + " " + b + " and you are " + c + " years old."
    Refactor the code and replace the variable names “a”, “b” and “c” with more human friendly names.