subject

An e-commerce company is currently celebrating ten years in business. They are having a sale to honor their privileged members, those who have been using their services for the past five years. They receive the best discounts indicated by any discount tags attached to the product. Determine the minimum cost to purchase all products listed. As each potential price is calculated, round it to the nearest integer before adding it to the total. Return the cost to purchase all items as an integer. There are three types of discount tags: • Type O: discounted price, the item is sold for a given price. • Type 1: percentage discount, the customer is given a fixed percentage discount from the retail price. • Type 2: fixed discount, the customer is given a fixed amount off from the retail price. Example products = [['10', 'do', 'd1'], ['15', 'EMPTY', 'EMPTY'], ['20', 'd1', 'EMPTY"]] discounts = [['d0','1','27'], ['d1', '2', '5']] The products array elements are in the form ['price', 'tag 1', 'tag 2', ..., 'tag m-1'). There may be zero or more discount codes associated with a product. Discount tags in the products array may be 'EMPTY' which is the same as a null value. The discounts array elements are in the form ['tag, 'type', 'amount'). 1. If a privileged member buys product 1 listed at a price of 10 with two discounts available: o Under discount do of type 1, the discounted price is 10 - 10 * 0.27 = 7.30, round to 7. • Under discount d1 of type 2, the discounted price is 10-5 = 5. o The price to purchase the product 1 is the lowest of the two, or 5 in this case 2. The second product is priced at 15 because there are no discounts available 3. The third product is priced at 20. Using discount tag d1 of type 2, the discounted price is 20-5= 15 The total price to purchase the three items is 5+ 15 +15 = 35. int find LowestPrice(int products_rows, int products_columns, char*** products, int discounts_rows, int discounts_columns, char*** discounts) { }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:40
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
question
Computers and Technology, 22.06.2019 02:00
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
You know the right answer?
An e-commerce company is currently celebrating ten years in business. They are having a sale to hono...
Questions
question
English, 18.01.2021 03:50
question
Mathematics, 18.01.2021 03:50
Questions on the website: 13722367