Home / Expert Answers / Computer Science / nbsp-if-you-are-able-to-could-you-put-the-code-in-c-please-and-thank-you-to-do-fill-in-pa522

(Solved):   If you are able to. Could you put the code in C++? Please and thank you. //TO-DO: Fill in ...



 

If you are able to. Could you put the code in C++? Please and thank you.

Modify Lab 11 Program.cpp to create a program that reads product information into an Item structure and calculates inventory

//TO-DO: Fill in the Authors Name Here
//TO-DO: Fill in the current date here
//CS1428 Lab
//Lab 11
//Description: this program will track an inventory of items.
//****************This is the line of 80 characters in length*******************
//############Your code should not exceed the length of the above line##########
#include <iostream>
#include <iomanip>
using namespace std;
//TODO: Create your struct
int main()
{
const int SIZE = 3;
Item inventory[SIZE];
int totalItems = 0,
cheapestIndex = 0;
double totalValue = 0;
for(int i = 0; i < SIZE; i++)
{
//TODO: Prompt/read item information
//adds current item quanitity to total items
totalItems += inventory[i].quantity;
//TODO: Compute total price
//TODO: Find the index of the cheapest item
cout << endl << endl;
}
//TODO: output the total number of inventory items,
//the total cost of all the items, and the cheapest item.
return 0;
}

Modify Lab 11 Program.cpp to create a program that reads product information into an Item structure and calculates inventory information (See Sample Output below). number of inventory items, the total cost of all the items, and the cheapest item. Item data should be stored in a struct variable of the type Item, which has three components: - name (string) - cost (double) - quantity (integer) There are 3 items. Use an array with 3 elements of the data type Item. \( > \) Read the item information into the structure array from the console. -Calculate the total quantity of all 3 items. -Calculate the total cost of all 3 items. - Find the index of the cheapest item.


We have an Answer from Expert

View Expert Answer

Expert Answer


Sol: C++ Program is modified as described in the question to get the desired output. Program: #include #include using namespace s
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe