GIVEN
I am a shop owner
AND
have a list of products containing, item name, type and price
WHEN
lunch time comes I want to offer a meal deal pack
WHEN
people buy one main dish, one snack and one drink
THEN
they pay just £3 for them
List of foods: foods.json
List of customers: customers.json
- Write a script that will calculate the value of the cart for each customer
- Write a script that will calculate what the foods that you need to buy so that the shop wins the MOST (promotion - price of cart)
- Write a script that will calculate what the foods that you need to buy so that the shop wins the LEAST (promotion - price of cart)
- Write a script that finds out which of the customers can benefit from the meal deal promotion and which don't, based on cart
- Write a script that determine how much money did the shop make during lunch break WITH meal deal promotion
- Write a script that determine how much money did the shop make during lunch break WITHOU meal deal promotion
- Determine if the meal deal promotion was a success or not?
Function to import and parse a json file:
import json
with open('data.json', 'r') as json_file:
date = json.load(json_file)
Function to write json file:
import json
with open('output.json', 'w') as json_file:
json.dump(data, json_file)