0

Argentina Code Solution: Help Needed

I can get 3 out of 5 tests to run correctly but now I am stuck. What am I missing? peso=gets.chomp.to_i dollar=gets.chomp.to_i #peso/50 = dollar if #{peso}/50 > #{peso} puts "Pesos" if #{peso}/50 < #{peso} puts "Dollars" end end

2nd Dec 2020, 2:02 AM
Joy Shadburn
Joy Shadburn - avatar
1 ответ
+ 2
There are 2 cents for every peso. So to convert to dollars (100 cents per dollar) you convert pesos to cents (pesos*2) then convert your cents to dollars (cents/100). Now you can compare using an if-else.
2nd Dec 2020, 2:12 AM
ChaoticDawg
ChaoticDawg - avatar