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

Provide the definition for each of the following structures and unions: a) Struc

ID: 3654630 • Letter: P

Question

Provide the definition for each of the following structures and unions:

a) Structure inventory containing character array partName[ 30 ], integer partNumber, floating point price, integer stock and integer reorder.

b) Union data containing char c, short s, long b, float f and double d.

c) A structure called address that contains character arrays streetAddress[ 25 ], city[ 20 ], state[ 3 ] and zipCode[ 6 ].

d) Structure student that contains arrays firstName[ 15 ] and lastName[ 15 ] and variable homeAddress of type struct address from part (c).

e) Structure test containing 16 bit fields with widths of 1 bit. The names of the bit fields are the letters a to p.

Explanation / Answer

a) struct inventory { char partName[ 30 ]; int partNumber; float price; int stock ; int reorder; }; b) union data { char c, short s, long b, float f , double d}; c) struct address { char streetAddress[ 25 ], city[ 20 ], state[ 3 ] , zipCode[ 6 ] }; d)structure student { char firstName[ 15 ], lastName[ 15 ] ; struct address ; };

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