Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Define a structure named StockItem with two string fields, supplier and prod

ID: 3862882 • Letter: C

Question

C++

Define a structure named  StockItem with two string fields, supplier and productName and one int field, catalogNumber. Then define a structure named  Customer with string fields name , streetAddress, city, postalCode, phone. Assume that structures named  Date andMoney have already been defined (representing a date and a monetary amount respectively.

Finally, define a structure named  Purchase that has these fields: buyer of type  Customer, itemSold of type  StockItem, dateOfSale of type  Date, paid of type  Money, returnable of type  bool.

Thank you

Explanation / Answer

   struct StockItem {
string supplier;
   string productName ;
};
  
   struct Customer{
       string name;
       string streetAddress;
       string city;
       string postalCode;
       string phone;
   };


   struct Date{
       string date;
   };


   struct Money
   {
   double money;  
   };


   struct Purchase{
       Customer buyer;
       StockItem itemSold;
       Date dataOfSale;
       Money paid;
       bool returnable ;
   };

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote