Posts by Cintia B • 37 points
3 posts
-
1
votes1
answer43
viewsQ: Argue when calling function
I’m trying to run my code below: class ProdutItem attr_reader :price_unit, :x_item, :price_promo def initialize(price_unit: , x_item: 1, price_promo: price_unit) @price_unit = price_unit @x_item =…
-
1
votes5
answers988
viewsQ: Error Split by 0
Hello I would like a help, I’m starting with language and I’m having some doubts, What I want in my code is that the division calculation is not divided by zero. The moment I enter the value of Y =…
-
0
votes1
answer1601
viewsQ: Undefined local variable or method
class ProdutItem attr_reader :item, :price_unit, :qtde def initialize(item, price_unit, qtde) @item = item @price_unit = price_unit @qtde = qtde end def calc_qtde (price_unit * qtde) end end prod =…