Question
matlab question: please help FunctionName malk Inputs 1. ( char) The filename of a text file containing your shopping list... Function Name malk Inputs 1.
matlab question: please help
FunctionName malk
Inputs 1. ( char) The filename of a text file containing your shopping list...
Function Name malk
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 inventory
Outputs
1. (char) A string stating the total cost of your grocery store run
Background
It's Sunday night and you need a late night snack before you finish your CS 1371
homework. You pour a bowl of some Lucky Charms and just need to grab that sweet CAlcium -
but wait!! You milk has expired! It has gone bad - it has turned into: MALK! Now you need to go
to the grocery store and buy more milk, among other things.
Function Description
Given a grocery list text file with each line in the form: '
and an excel file that contains an inventory for the grocery store you are visiting. The first
column 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). Your job is to calculate the total cost of your
grocery store run and output the string 'My total will be $
has 2 decimal places.
Example
If the stores inventory is and your grocery list has,
8 Apples 2.08 Milk 1
5 Milk 4.02 eggs 12
36 Eggs .72
Then your function should output:
'My total will be $12.66.
Notes
The grocery list will have only 1 item per line, and each item will be one word
Case does not matter
You are guaranteed to find everything you need and the store will always have enough
You do NOT have to update the stores inventory
Hints
You should use %0.2f to put a number with 2 decimal points in a string.
Remember how certain string functions work on cell arrays.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started