==============================================================================
How many ounces of wormwood are needed? 0
How many ounces of nettles are needed? 5.0
How many snake fangs are needed? 20
How many horned slugs are needed? 0
How many porcupine quills are needed? 20
How many potion vials are needed? 10
*-----*-----*-----*-----*-----*
MalWart:
Item
Quantity
*-----*-----*-----*-----*-----*
Snake Fangs
20.00
Porcupine Quills 20.00
Potion Vials 10.00
*-----*-----*-----*-----*-----*
Hit any key, then enter to continue
x
*-----*-----*-----*-----*-----*
California Dreams:
Item
Quantity
*-----*-----*-----*-----*-----*
Nettles (in oz.) 5.00
*-----*-----*-----*-----*-----*
Hit any key, then enter to continue
x
*-----*-----*-----*-----*-----*
Local price list:
Item
Ga Si Kn
*-----*-----*-----*-----*-----*
Snake Fangs
0 10 28
Porcupine Quills 0 2 11
Potion Vials 0
10 9
Nettles (in oz.) 0 9 16
*-----*-----*-----*-----*-----*
Hit any key, then enter to continue
x
==============================================================================
To get you started, here is an example function.
Function Name: PrintSeparator
Description: This function prints the line
*-----*-----*-----*-----*-----*
to use as a separator line in the reports.
Helpfulness: If a person wanted to change the separator to be
all asterisks, this could be done easily if the line is printed using a
function.
Description: This function prints one price report listing the items and quantities at certain stores. This will also call the function PrintSeparator.
Helpfulness: If several reports need to be printed (as in this case), it makes sense to create one function to print each item and quantity summary. Also, if the company wanted to change the format of the item and quantity summaries this could be done easily with the modification of a single function.
Function: PrintHitAnyKey
Description: This function prints "Hit any key, then enter to continue".
Helpfulness: This function is used multiple times in the printing of the report and allows the programmer to specify once the printf statement containing "Hit any key, then enter to continue".
Function: PrintLocalPrices
Description: This function prints the local price list with the items and the costs.
Helpfulness: Putting the printing of the price list in a single function keeps the code organized and allows for an easy change if the format is to be modified.