![]() Because the pricing changes frequently, we need to be able to pass in a set of pricing rules each time we start handling a checkout transaction.Ĭalculates the sum of integers in a string separated by a comma. Our checkout accepts items in any order, so that if we scan a B, an A, and another B, we’ll recognize the two B’s and price them at 45 (for a total price so far of 95). In fact this week’s prices are: Item Unit Price Special Price For example, item ‘A’ might cost 50 cents individually, but this week we have a special offer: buy three ‘A’s and they’ll cost you $1.30. In addition, some items are multipriced: buy n of them, and they’ll cost you y cents. ![]() In our store, we’ll use individual letters of the alphabet (A, B, C, and so on). In a normal supermarket, things are identified using Stock Keeping Units, or SKUs. Supermarket checkout that calculates the total price of a number of items. Done in C# through a TDD approach.įizzbuzz is a drinking game where players take turns to count incrementally, replacing any number divisible by three with the word "fizz", and any number divisible by five with the word "buzz".įibonnaci is a sequence of numbers where the first number is 0, the second 1 and the subsquent the sum of the previous two.Ġ, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 114.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |