Declare a structure date that includes the integer members month, day, and year.
ID: 3774063 • Letter: D
Question
Declare a structure date that includes the integer members month, day, and year. Declare a structure customer_info that includes a character array customer_id with 10 elements, a character acct_type, a character array name with 20 elements, a double element balance, an pay_date of type date. Declare a structure variable customer of type customer_info and initialize it to 11, 17, 2016, 'E', " A567X", 586.50, "John Smith".Consider the following structure definition: Struct Name {string first; string middle; string last;}; Given the declaration above, and the following declarations: struct studentRecord {Name studentName; Name teacherName; int gradeNumber: string grades;}; studentRecord sally; Assign the name Michelle Ellen Smith to the studentName field of variable sally; Assign the grade number 7 to that field of sally? Assign the fourth letter from the grades field to char variable spring? onsider the following structure definition: struct item {char part_no[8]; char desc[20]; float price; int int_stock;};Explanation / Answer
1
a.
struct date
{
int month;
int day;
int year;
};
b
struct customer_info
{
char customer_id[10];
char acct_type;
char name[20];
double balance;
struct date pay_date;
};
c.
struct customer_info customer = {"A567X",'E',"John Smith",586.50,11,17,2016};
II
sally.studentName = {"Michelle","Ellen","Smith"};
sally.gradeNumber =7;
sally.grades[3] = spring;
//assuming char spring is declared in the code and fourth letter is at index 3 as starting index =0
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.