Math


#1

If i have given three operations in math why it is not showing every result?


#2

Are you using prints / puts to display the results? If not, then they shouldn't show up; you didn't tell them to.


#3

I have not used print or puts for anything but only one operation output is being displayed


#4

If your code doesn't say to print anything, then the weird part would be that anything at all is printed.
That's something codecademy does for whatever reason


#5

Im having the same issue with my operations.. its just showing results for the first one
my_num=3**2=9
my-num=5-4=1
my_num=3*4=12
im not even clear if this is how you input the data with the arithmetic operators


#6

i am also learning ruby here.. i think we should ignore this this because if we dnt have anything to print codecademy for some reason prints the last thing on screen.. all we should follow is we must use print or puts to display on screen


#7

When I run your code, it does not show results for the first one, it instead points out that you have a syntax error there. An unexpected =.

How do you think that a mathmatical equation with two = would work? What would you want it to do?


#8

I'm not really sure what to do here either. I'm fairly new to the whole world of code. In fact, I had been only part way through the first steps of Codecademy, but then had to quit for a while because they wouldn't let me proceed, nor show me where I had made an error in the script that I was writing. It's really frustrating that there isn't some hint tool to show where a mistake is.

Anyway, I logged back on today and found that for some reason the program had let me continue past wherever it was I had last left off (I think it was with writing a website or maybe just past that). Here I am, cruising through Ruby, when I can't figure out how to submit a calculation (division, addition, exponentiation, etc) for the life of me. Are we supposed to input the answer ourselves? If so, what's the point of writing the equation in Ruby?

This is really frustrating. Is there just something I'm missing? It could be as basic as how to submit a line to the computer and I just forgot how to do that. Please help!


#9

AH! I actually got it figured out! YOu're not supposed to put the answer in :grin: In fact, if you write just one line and submit that, the program will calculate it in the box to the right. Shazam.

Hope this helped you guys. Once again, it'd be so much better if Codecademy used more interactive instructions :)stuck_out_tongue_winking_eye:


#10

Thanks, I was wondering the same thing and now I know thanks to you :grin:


#11

The result I get is: 777 for the first code only. What did I do wrong? Here is an example of my code.

variable_sum = sum = 13 + 379
variable_product = product = 923 * 15
variable_quotient = quotient = 13209 / 17


#12

will work
sum = 13 + 379
product = 923 * 15
quotient = 13209 / 17


#13

A post was split to a new topic: Where do I get editor?