Write a function named “createPurchaseOrder” that accepts the quantity (integer), the cost per item(double), and the description(string). It will return a newly created PurchaseOrderobject holding that information if they are valid: quantity and cost per item cannot be negative and the description can not be empty or blank(s). When it is invalid, it will return NULL to indicate that it cannot create such PurchaseOrderobject.

Respuesta :

#include
Program: using namespace std;
string createPurchaseOrder0;
int main(
{
cout<return 0;
}
string createPurchaseOrder(
{
int qty;
double costPerltem;
string description,info="":
cout<<"Enter Quantity:
cin>>qty;
cout<<"Enter cost per item: "
cin>>costPerltem;
cout<<"Enter Description: "
cin>>description;
if(qty<0 I| costPerltem<0
Idescription.compare(''"')==0)
cout<<'InThe entered data is invalid!":
info="":
else
"
cout<<"'InThe entered data is valid!":
info=info+"'(nQuantity: "+to_string (qty) +" In";
info=info+"Cost per item:
"†to_string (costPerltem)+"In";
info=info+"Description: "description+" In";
return info;

Output:
ACCESS MORE