💎 LearnRuby
Lessons Leaderboard
EN RU
Sign In Sign Up
Lessons Leaderboard
Language: EN RU
Sign In Sign Up
Lessons / Calculator
Module 1 Beginner Ruby 3.4

Calculator

Ruby 3.4

Build a calculator with various operations. Learn about arrays and iteration.

Exercise (4)

â—‹
1.

Add Two Numbers

Create a simple addition function.

10 points functions math
â—‹
2.

Sum an Array

Sum all numbers in an array using Ruby's built-in methods.

15 points arrays iteration
â—‹
3.

Factorial

Calculate the factorial of a number.

20 points recursion iteration
â—‹
4.

Product with Reduce

Use reduce to multiply all numbers in an array.

20 points reduce inject

Lesson Info

Beginner
Beginner
Exercise
4
Total Points
65
Ruby Version
3.4
Sign in to start
Back to all lessons

LearnRuby - Learn Ruby 3.4 with interactive exercises