Given the following structure and variable definitions: struct contact { char... 1 answer below »

  • 31 + Users Viewed

  • 1 + Downloaded Solutions

  • New Jersey, US Mostly Asked From

Given the following structure and variable definitions:

struct contact {

          char phoneNumber[11];

          char address[50];

          char city[15];

          char state[3];

          char zipCode[6];

          };

struct customer {

          char lastName[15];

          char firstName[15];

          int customerNumber;

          struct contact personal;

} customerRecord;

A program to include above structure definition, and use the structure to enter/scanf() and display/printf() the structure members in each of the following parts:

a. Member lastName of structure customerRecord

b. Member firstName of structure customerRecord

c. Member customerNumber of structure customerRecord

d. Member phoneNumber of member personal of structure customerRecord

e. Member address of member personal of structure customerRecord

f. Member city of member personal of structure customerRecord

g. Member state of member personal of structure customerRecord

h. Member zipCode of member personal of structure customerRecord

 

Try Solving it with these steps:

These are AI-generated tips. For the verified answer, click “Solution.pdf.”

To effectively solve the problem, consider the following tips:

  • Understand Structures: Familiarize yourself with the structure definitions and their members.
  • Input/Output Functions: Use scanf() for input and printf() for output.
  • Access Members: Use the dot operator to access structure members.
  • Order of Operations: Follow the sequence of parts (a to h) for clarity.
  • Data Types: Ensure correct data types are used for each member.
View More

1 Approved Answer

Jones G
5 Ratings (12 Votes)
**a. Member lastName of structure customerRecord** To access the member `lastName` of the structure `customerRecord`, you can use the following code snippet: ```c printf("Last Name: %s\n", customerRecord.lastName); ``` This will print the last name stored in the `lastName` member of the `customerRecord` structure. **b. Member firstName of structure customerRecord** To access the member `firstName` of the structure...

Recent Questions in Programming Languages

Plagiarism Checker

Submit your documents and get free Plagiarism report

Free Plagiarism Checker