Function Name: getThisBread
Inputs:
1. (char) The filename of a text file containing your shopping list
2. (char) The filename of an Excel file containing a grocery store inventor
Outputs:
1. (char) A string stating the total cost of your grocery store run.
Topics: (Low Level Reading), (Lookup Table)
Background:
It is time to get this Bread.
Function Description:
You are given a grocery list text file with each line in the form:
'<item>, <number of items>'
and an Excel file that contains an inventory for the grocery store you are visiting. The first
column in the inventory has the number of items in stock, the second column will have the item
name, and the third column has the price per unit (in dollars). Write a function that calculates
the total cost of your grocery store run and outputs the string:
'My total will be $<total>.'
Example:
inventory.xlsx ?
list.txt
13
Butter Bread
2.08
1 whole wheat bread, 1
5
Whole Wheat Bread
4.02
2 BUTTER BREAD, 12
36
Honey Wheat Bread
0.72
out = getThisBread('list.txt', 'inventory.xlsx')
out ?
'My total will be $28.98.'
Notes:
• Matching grocery items should be case insensitive.
• You are guaranteed to find everything you need and the store will always have enough.
• You do not have to update the store's inventory
• Round your price to 2 decimal places.