Question: ItemToPurchase.h - Struct definition and related function declarations ItemToPurchase.c - Related function definitions main.c - main ( ) function Build the ItemToPurchase struct with the
ItemToPurchase.h Struct definition and related function declarations
ItemToPurchase.c Related function definitions
main.c main function
Build the ItemToPurchase struct with the following specifications:
Data members pts
char itemName int itemPriceint itemQuantity
Related functions
MakeItemBlank pts
Has a pointer to an ItemToPurchase parameter.Sets item's name "none", item's price item's quantity
PrintItemCost
Has an ItemToPurchase parameter.
Ex of PrintItemCost output:
Bottled Water @ $ $
In main prompt the user for two items and create two objects of the ItemToPurchase struct. Before prompting for the second item, enter the following code to allow the user to input a new string. c is declared as a char. pts
c getchar; whilec
&& c EOF c getchar;
Ex:
Item Enter the item name: Chocolate Chips Enter the item price: Enter the item quantity: Item Enter the item name: Bottled Water Enter the item price: Enter the item quantity:
Add the costs of the two items together and output the total cost. pts
Ex:
TOTAL COST Chocolate Chips @ $ $ Bottled Water @ $ $ Total: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
