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

develop a structure declaration (see template below) that will model the attribu

ID: 3641002 • Letter: D

Question

develop a structure declaration (see template below) that will model the attributes you see on your drivers license. 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)
• 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.

/* 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 */
struct date birthDate; /* the date the driver was born */
/* add other members */
};

/* declare an array of SIZE number of drivers */
struct license drivers[SIZE];

Explanation / Answer

struct date { int month; int day; int year; }; struct cont{ char email[30]; /*Licensor Email address.*/ int phone1 ;/* Licensor phone number1* int phone2 ;/* Licensor phone number2*/ } struct license { char name[25]; /* name of the license holder */ char number[25]; /* alpha numeric license number */ struct date birthDate; /* the date the driver was born */ char licensee[25] /*Name of each Licensee.*/ char address[30]; /* Licensor street address. */ char city[30]; /* Licensor City name */ int postal ; /*Licensor Postal Code or Zip Code.*/ char province[20]; /* Licensor Country name */ char country[30]; /* Licensor Country name */ cont contact ; /* list of contact info */ char[50] notes /*Supplemental information for use in identifying and contacting the Licensors.*/ /* add other members if you see any missing*/ }; /* declare an array of SIZE number of drivers */ struct license drivers[SIZE]; /* I have added the members after looking at the format of license ..if you find any missing ..let me know so that i can tell you its data type too */