#include structure definition functionl that prints out a character array function2 that scans a character array function3 that scans info of passport (this function should call function 2) function4 that prints out information of passport (this function should call function 1) main function ask how many passports create array of structures iterate through each structure and get information iterate through each structure and print out information How many passports will we be creating today? 2 Please input ID of passport 1: 15625 what is the gender? M First Name? (end with a dot)Kyle. Last Name? (end with a dot)Smith. Address? (end with a dot)123 Lead Ave SE. Please input ID of passport 2: 15626 What is the gender? F First Name? (end with a dot)clair. Last Name? (end with a dot) Smith. Address? (end with a dot)1059 Dr MLK Jr NE. Info of User 1: ID: 15625 Gender: M First Name: Kyle Last Name: Smith Address: 123LeadAveSE Info of User 2: ID: 15626 Gender: F First Name: Clair Last Name: Smith Address: 1059DrMLKJrNE

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question

Programing C

First, you should ask how many passports will be issued.
Then, ask for the first name, last name, address, passport ID and gender of each passport.
Lastly, print out the information.

Follow some guidelines when writing your code: You should have one structure definition with the following members:
· FirstName: should be a character array, accepting at most 100 characters
· LastName: should be a character array, accepting at most 100 characters
· Address: should also be a char array, accepting at most 100 characters
· PassportID: should be an integer
· Gender: should be a single character

You should at least have five functions (including main) in your code. You can have more if you want, but you should at least have five. I recommend the following functions

· One function that scans the information of each passport.
· One function that scans a character array. In my opinion, this is the most important one, since you will be able to re-use it every time you need to read a first name, a last name or an address.
· One function that prints out the information of each passport.
· One function that prints out contents inside a character array. Also of ample importance, since you will be able to re-use it every time you need to print a first name, last name or address.
· Your main function.

If you follow my recommendations your program’s layout would look something like this:

Also there is an example of the output

#include <stdio.h>
structure definition
functionl that prints out a character array
function2 that scans a character array
function3 that scans info of passport (this function should call function 2)
function4 that prints out information of passport (this function should call function 1)
main function
ask how many passports
create array of structures
iterate through each structure and get information
iterate through each structure and print out information
Transcribed Image Text:#include <stdio.h> structure definition functionl that prints out a character array function2 that scans a character array function3 that scans info of passport (this function should call function 2) function4 that prints out information of passport (this function should call function 1) main function ask how many passports create array of structures iterate through each structure and get information iterate through each structure and print out information
How many passports will we be creating today? 2
Please input ID of passport 1: 15625
what is the gender? M
First Name? (end with a dot)Kyle.
Last Name? (end with a dot)Smith.
Address? (end with a dot)123 Lead Ave SE.
Please input ID of passport 2: 15626
What is the gender? F
First Name? (end with a dot)clair.
Last Name? (end with a dot) Smith.
Address? (end with a dot)1059 Dr MLK Jr NE.
Info of User 1:
ID: 15625
Gender: M
First Name: Kyle
Last Name: Smith
Address: 123LeadAveSE
Info of User 2:
ID: 15626
Gender: F
First Name: Clair
Last Name: Smith
Address: 1059DrMLKJrNE
Transcribed Image Text:How many passports will we be creating today? 2 Please input ID of passport 1: 15625 what is the gender? M First Name? (end with a dot)Kyle. Last Name? (end with a dot)Smith. Address? (end with a dot)123 Lead Ave SE. Please input ID of passport 2: 15626 What is the gender? F First Name? (end with a dot)clair. Last Name? (end with a dot) Smith. Address? (end with a dot)1059 Dr MLK Jr NE. Info of User 1: ID: 15625 Gender: M First Name: Kyle Last Name: Smith Address: 123LeadAveSE Info of User 2: ID: 15626 Gender: F First Name: Clair Last Name: Smith Address: 1059DrMLKJrNE
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr