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 ;
};
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.