Cybertronic
Technical User
- May 18, 2006
- 19
I thought this would be the best place to ask about for Haskell, I apologise if I've put it in the wrong place, sorry!
I'm trying to create a function called display where I type in a product name, e.g. dvd1, it returns the string and the total value of the stock held for the product:
Here's what I've done so far:
My display function only shows the string but unfortunately I'm stuck on how to get the display function to multiply q (Int) and i (Double) together and display it next to d.
Can someone help me out pretty please?
I'm trying to create a function called display where I type in a product name, e.g. dvd1, it returns the string and the total value of the stock held for the product:
Here's what I've done so far:
type Product = (Int,String,Int,Double)
dvd1 :: Product
dvd1 = (1, "Space", 5, 9.99)
display :: Product -> String
display (c,d,q,i) = d
My display function only shows the string but unfortunately I'm stuck on how to get the display function to multiply q (Int) and i (Double) together and display it next to d.
Can someone help me out pretty please?