Ask Question
3 August, 11:56

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 and Money 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.

+3
Answers (1)
  1. 3 August, 14:02
    0
    struct StockItem {

    char supplier[50], productName[50];

    int catalogNumber;

    };

    struct Customer {

    char name[50], streetAddress[50], city[50], postalCode[50], phone[50];

    };

    struct Purchase {

    struct Customer buyer;

    struct StockItem itemSold;

    struct Date dateOfSale;

    struct Money paid;

    bool returnable;

    };

    Explanation:

    - Create a struct named StockItem with required fields: char supplier[50], productName[50]; int catalogNumber;

    - Create a struct named Customer with required fields: char name[50], streetAddress[50], city[50], postalCode[50], phone[50];

    - Create a struct named Purchase with required fields: struct Customer buyer; struct StockItem itemSold; struct DatedateOfSale; struct Money paid; bool returnable;

    };

    * struct Date and Money is assumed to be created as specified in the question
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Define a structure named StockItem with two string fields, supplier and productName and one int field, catalogNumber. Then define a ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers