---
# System prepended metadata

title: Day 1 Activities
tags: [Gemcamp]

---

# Printing, Variables and operators

Create a new repository on GitHub named gemcamp_ruby_basic. Inside this repository, create a folder called printing_variables_operators. As you work on the questions, make sure to commit each one individually with clear commit messages that describe the problem you solved.

1. Print your name and age using variables.
1. Create two variables and concatenate like your first name and a last name.
1. Create a variable for your favorite number, double it, and print the result.
1. Ask for a user’s name and print a greeting including their name.
1. Store the sum of 45 and 10 in a variable and print it.
1. Create a variable for your city and print a sentence using it.
1. Multiply two numbers, store the result, and print it.
1. Create two variables: one for your birth year and one for the current year. Calculate and print your age.
1. Create a variable for a favorite food and print it three times.
1. Subtract two numbers and store the result. Print the sentence: “The difference is ___.”
1. Combine a greeting and a name into a single print statement using variables.
1. Divide 100 by 4, store the result in a variable, and print it.
1. Create a variable for a fruit name, and print a sentence saying, “I love to eat [fruit].”
1. Calculate and print the result of (10 + 5) * 2.
1. Create two variables, x and y, and swap their values. Print both before and after swapping.
1. Concatenate three strings: your name, hobby, and favorite color, and print them.
1. Print the result of a mathematical expression: (25 - 5) + (12 * 3).
1. Create two variables with any words and print them combined in one sentence.
1. Ask the user to input two numbers, multiply them, and print the result.
4. Ask the user for their birth year, calculate how old they will be in 5 years, and print it.
6. Ask the user to input their height in centimeters, convert it to meters, and print the result.
7. Print the result of dividing 50 by a variable, then print the remainder using modulo.
8. Create two string variables: one for a book title and one for the author. Print a sentence about the book.
9. Ask the user to input a number and print its square (the number multiplied by itself).
10. Create a variable for the current temperature in Celsius and convert it to Fahrenheit. Print both values.
11. Concatenate the first three characters of a string with the last two characters of another string and print the result.
12. Create a variable for the price of two items, calculate the total, and print it with a message like “The total is [total].”
13. Ask the user to input a word and print the length of the word using the .length method.
14. Ask the user to input a sentence, convert the entire sentence to uppercase, and print the result.
15. Ask the user for a word, extract and print the first 5 characters.
16. Ask the user for a word, reverse the word and print it.
17. Ask the user for a number and print the square of the number.
18. Ask the user to input their name and print the name with the first letter capitalized using .capitalize.
19. Ask the user for a number and print the square root of the number.
20. Take a sentence and convert all the letters to lowercase, then print it.
1. Write a Ruby program that adds 12 and 8, then prints the result.
1. Subtract 20 from 45 and display the result using Ruby.
1. Multiply 7 by 9 and print the product.
1. Divide 100 by 5 and show the quotient in your Ruby program.
1. Find the remainder when 29 is divided by 4 and print it.
1. Write a Ruby program to calculate 3 raised to the power of 4.
1. Start with the number 50, add 30 to it using the += operator, and print the new value.
1. Begin with the number 100, subtract 25 from it using the -= operator, and display the result.
1. Using the number 8, multiply it by 5 with the *= operator, then print the result.
1. Start with 64, divide it by 8 using the /= operator, and print the final result.