Skip to content

CristinaAliman/PythonExercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tesco lunch time offer

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

  1. Write a script that will calculate the value of the cart for each customer
  2. 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)
  3. 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)
  4. Write a script that finds out which of the customers can benefit from the meal deal promotion and which don't, based on cart
  5. Write a script that determine how much money did the shop make during lunch break WITH meal deal promotion
  6. Write a script that determine how much money did the shop make during lunch break WITHOU meal deal promotion
  7. 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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages