Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In main.c Build the item purchase struct with the following specifications 3) add the cost of the two items together and output the total cost.

In main.c
Build the item purchase struct with the following specifications image text in transcribed
3) add the cost of the two items together and output the total cost.
Ex. Total cost
Chocolate chips 1 @ $3 =$3
Bottle water 10 @1$ =$10
Total: $13
#include
#include
Int main( ) {
/* type your code here */
return 0;
}
In the photo I uploaded it gives you the first two descriptions, I wrote the third description via text. If you can please write the code in basic C please for beginners. Itll be a lot of help
In main.c Build the ItemToPurchase struct with the following specifications Data members char itemName [50] . int itemPrice . int itemQuantity and create two functions . MakeltemBlank0 o Has a pass by reference ItemToPurchase parameter Reference Figure 7.4.1 o Sets items name "none. item's price 0, item's quantity-0 . PrintitemCost o Has a pass by value ltemToPurchase parameter Ex. of PrintitemCost output Bottled Water 10 1 10 (2) In main0. prompt the user for two items and create two objects of the ItemToPurchase struct. Before prompting for the second item enter frusn(stdin); to a?ow the user to input a new string Ex Item 1 Enter the icem name: Chocolate Chips Enter the icem price: 3 Enter the icem quantity: Icem 2 Enter the icem name: Boccied Water Encez the irem price: 1 nter :ht item quantity: 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions