Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cost(length,width,colors)
- x = length * width;
- if colors > 2
- x += colors * 15
- else
- x += colors * 10
- end
- return x * 1.15
- end
- puts cost(10,10,0);
- puts cost(10,10,1);
- puts cost(10,10,2);
- puts cost(10,10,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement