Advertisement
Guest User

Untitled

a guest
May 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def cost(length,width,colors)
  2. x = length * width;
  3. if colors > 2
  4. x += colors * 15
  5. else
  6. x += colors * 10
  7. end
  8. return x * 1.15
  9. end
  10.  
  11. puts cost(10,10,0);
  12. puts cost(10,10,1);
  13. puts cost(10,10,2);
  14. puts cost(10,10,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement