IDNLearn.com is your go-to platform for finding reliable answers quickly. Ask any question and get a thorough, accurate answer from our community of experienced professionals.
Sagot :
The programme uses the parameters notebookinfo and addqty to run the function increaseitemqty, then assigns notebookinfo the value received.
Explain the term "function calling"?
- When calling a function is necessary, it is invoked inside of a program.
- Only in a program's main() method is it called by its name.
- The parameters can be passed to a function that is called from the main() function.
#include <iostream>
#include <string>
using namespace std;
struct ProductInfo {
string itemName;
int itemQty;
};
ProductInfo IncreaseItemQty(ProductInfo productToStock, int increaseValue) {
productToStock.itemQty = productToStock.itemQty + increaseValue;
return productToStock;
}
int main() {
ProductInfo notebookInfo;
int addQty;
cin >> notebookInfo.itemName >> notebookInfo.itemQty;
cin >> addQty;
/* Your code goes here */
cout << "Name: " << notebookInfo.itemName << ", stock: " << notebookInfo.itemQty << endl;
return 0;
}
Thus, the program uses the parameters notebookinfo and addqty to run the function increaseitemqty, then assigns notebookinfo the value received.
To know more about the function calling, here
https://brainly.com/question/25741060
#SPJ4
We appreciate your participation in this forum. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. Thank you for choosing IDNLearn.com for your queries. We’re here to provide accurate answers, so visit us again soon.