Xcode programming coding and for 2 people with DIFFERENT CODE

Job ID: 33226168

Budget: $30 – $250 USD

Briefing:

1. You are to download the starter project (Shopping Task) from Moodle.

2. The project is designed to apply offers to a shopping list. Classes for the existing application have been created, but methods need to be modified.

3. Each offer has its own class, which implement (either directly or indirectly) the 'Offer' protocol. The base Offer protocol, and derived protocols can be found in the Offer.swift file. The protocols are documented, and you are advised to familiarise yourself with the various Offers.

4.The project is set up so that you can test (to a reasonable extent) whether your implementations are correct using programming tests that have already been written. Work will also be checked manually you must not write methods to 'cheat' the tests!

5. The tests are grouped into ten categories. Passing the tests in each group (assuming correct. implementation) will be worth 8 marks. All tests in the group must pass to get the 8 marks. If any test fails, the mark for that group will be zero. The speed tests are an exception to this and can be awarded on an individual basis.

6. The Transaction class has two methods that need implementing. In both cases the logic should be relatively trivial that need implementing as follows:

func priceBeforeDiscounts() -> Int

This method should return the sum of the price of all items in the Receipt class's items property

func finalPrice() -> Int

7. This method should return the total price, minus the value of any discounts.

8. The Offer protocol has two methods that need implementing for each type of Offer as follows:

func applies(to purchases: [Product]) -> Bool

9. This method should determine if the offer can be applied to the list of products. For example, if the offer was a 'buy one get one free offer', and the list only contained one item, the offer could not be applied, similarly if there were multiple items in the list, but none were on offer, it should also not apply. This method should execute more quickly than the one below.

func discount(for purchases: [Product])-> Int

10. This method should determine the value of the discount that should be applied to the list for the offer. It should not be arbitrarily slow and must not call the 'applies' method.

11. You must read the documentation comments on the protocols that the offers implement to understand how the offers should work. It does not always match the way an offer might be applied in a supermarket.

12!!!!!. THE ONLY FILES YOU CAN MODIFY ARE:

A. Files in the SpecificOffers group

B. Transaction.swift

C. Protocol Extensions.swift

12. Do not modify the Target Membership of any of the classes.

13. Do not attempt to determine the price of a product object via any other means than looking that the object's price property.