Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Basics (Retired) Ruby Numbers Multiplication and Division

Task: Set the variable product to be a multiple of a & b. a=6 b=2

a = 6 b = 2 12 Shouldn't the answer be 12?

variable.rb
a = 6
b = 2
c = 12
Neil Ganotisi
Neil Ganotisi
20,975 Points

Right idea, but you missed a few critical things. You'll need to declare a variable 'product', and set it to be the product of the multiple of 'a' and 'b'.

a = 6
b = 2

product = a*b

2 Answers

Thanks, Neil. You are correct. That worked. What's odd is this wasn't one of the formulas shown in the video series. I even checked the script on each video. Same thing with the second question. It's not material that's been gone over:

Set the variable quotient to be the result of dividing the product variable by 3. (The question might as well be in Arabic - something I'm not familiar with)

This is what your not seeing Sarah Set the variable.. in order to write code with variables you put the variable which is PRODUCT in the front like this product =