Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HASKELL CODING The exercises are commented out with explanations 7type BarCode Int 8 type Price type Name String Int 1 type Pricelist [(Barcode, Name, Price)]

HASKELL CODING
The exercises are commented out with explanations image text in transcribed
image text in transcribed
image text in transcribed
7type BarCode Int 8 type Price type Name String Int 1 type Pricelist [(Barcode, Name, Price)] 3 database PriceList 4 database (1848, "Vanilla yogurt cups (4)", 188), 316), 299), 307), 825) 788), 13949), 334), (1620, "Ground turkey (1 lb)", (1492, "Corn flakes cereal", (1773, "Black tea bags (1e0)", (2525, "Atletic socks (6)", (9595, "Claw hamner". (1945, "32-in TV", (1066, "Zero sugar cola (12)". (2818, "Haskell programming book". 4495) 5 17 18 19 20 21 23 25 type CartItems[BarCode] 26 type CartPrices I(Name,Price)] 28 30 29 Excersices 32list of barcodes of the items in a shopping cart and 36 type Bill (CartPrices, Price, Price, Price) 40 9. Takes the list of item prices and contructs a Bill tuple -- 8. Takes a database of product prices (price list) and a 33generates the list of item prices 4 priceCart:: Pricelist -> cartItems -> Cartprices 37 38 39 In carrying out this calculation, the function uses the following n constant: 41- 42 makeBill:: CartPrices BiLL 43 45 taxRate:: Double 46 taxRate=0.07 47 48 49 formatBill:: Bill - String 50 -- converti it ot a printable receipt 7type BarCode Int 8 type Price type Name String Int 1 type Pricelist [(Barcode, Name, Price)] 3 database PriceList 4 database (1848, "Vanilla yogurt cups (4)", 188), 316), 299), 307), 825) 788), 13949), 334), (1620, "Ground turkey (1 lb)", (1492, "Corn flakes cereal", (1773, "Black tea bags (1e0)", (2525, "Atletic socks (6)", (9595, "Claw hamner". (1945, "32-in TV", (1066, "Zero sugar cola (12)". (2818, "Haskell programming book". 4495) 5 17 18 19 20 21 23 25 type CartItems[BarCode] 26 type CartPrices I(Name,Price)] 28 30 29 Excersices 32list of barcodes of the items in a shopping cart and 36 type Bill (CartPrices, Price, Price, Price) 40 9. Takes the list of item prices and contructs a Bill tuple -- 8. Takes a database of product prices (price list) and a 33generates the list of item prices 4 priceCart:: Pricelist -> cartItems -> Cartprices 37 38 39 In carrying out this calculation, the function uses the following n constant: 41- 42 makeBill:: CartPrices BiLL 43 45 taxRate:: Double 46 taxRate=0.07 47 48 49 formatBill:: Bill - String 50 -- converti it ot a printable receipt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions