Saved Bookmarks
| 1. |
There is a shop with old-style cash registers. the price of each item is typed manually. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. Determine the number of errors in selling price.E.g. Input: products = ['eggs','milk','cheese'] productPrices = [2.89,3.29,5.79] productsSold = ['eggs','eggs','milk','cheese'] sellingPrices = [2.89,2.99,3.29,5.97] Output: errors = 2 |
|
Answer» Answer: There is a shop with old-style cash registers. the price of each item is typed manually. Given a list of items and their CORRECT prices, COMPARE the prices to those ENTERED when each item was sold. Determine the number of errors in SELLING price. E.g. Input: PRODUCTS = ['eggs','milk','cheese'] productPrices = [2.89,3.29,5.79] productsSold = ['eggs','eggs','milk','cheese'] sellingPrices = [2.89,2.99,3.29,5.97] Output: errors = 2 |
|