Question: C Structures and Arrays Develop a structure declaration (see template below) that will model the attributes you see on your drivers license. You do not
C Structures and Arrays
Develop a structure declaration (see template below) that will model the attributes you see on your drivers license. You do not have to populate it with actual information, just provide a set of structures that could be use to model and capture the driver license data. Think of what type each member of the structure should be, for example int (whole numbers) float (floating point) double (floating point with many decimal places) char (single character) char name[x] (character string ... x is the size, name is variable, what is a worst case size to handle your information on anyone?) struct name (a structure with one or more members) You will probably note that many of your members in the struct license item will probably be structures themselves. Look at each item on your license and think if there is a group of data that belongs together. For example, when I see DOB on my license, its contains a date value that has month, day, and year. You will also see other things, for example, license number, that probably make more sense just being a simple member that is itself not a structure type. Do research your home state's driver's license on their web sites if you are unsure of particular fields and usage. I know each state's drivers license has its own unique qualities, but most have have basically the same information. /* add structures */ #define SIZE 5 /* add supporting structures */ struct date { int month; int day; int year; }; /* add other supporting structures */ /* the actual license structure that will contain all needed members */ struct license { char number [25]; /* alpha numeric license number - combo of letters and numbers, 25 should be enough */ struct date birthDate; /* the date the driver was born, note that its a structure member within the license structure */ /* add other members - some will be structure types, */ /* others will be one of the types mentioned above */ }; /* declare an array of SIZE number of drivers */ struct license drivers [SIZE];
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
