Home / Expert Answers / Computer Science / 4-given-the-following-c-code-struct-retailitem-string-sku-stock-keeping-unit-string-na-pa527

(Solved): 4. Given the following C++ code: struct RetailItem { string sku; // Stock Keeping Unit string na ...



4. Given the following C++ code:

struct RetailItem

{

string sku; // Stock Keeping Unit

string name; // Description

int quantity; // Quantity on hand

double unitCost; // Unit value in dollars

};

RetailItem inventory[20];

 

Write the C++ programming statement that will assign the value 638 to the quantity member of the fourth entry in the array of RetailItem structures named inventory.

5. The sku for the retail item named Hammer is 34598. This retail item has a quantity of 542 and a unit value of $34.89. Using the RetailItem structure and array definition in question 4, write the C++ statements necessary to load the second entry in the array of RetailItem structures called inventory with the Hammer member values.



We have an Answer from Expert

View Expert Answer

Expert Answer


Statement that will assign the value 638 to the quantity member of the fourth entry in the array of RetailItem structures named inventory: inventory[3
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe