Question: this is a c++ question...please help...urgent Complete the following program with appropriate C++ statements. This program stores the information of 50 Persons using structures. Declare

this is a c++ question...please help...urgent

Complete the following program with appropriate C++ statements. This program stores the information of 50 Persons using structures. Declare a structure to represent a name with two (2) members of type char array with size 30 named firstname and lastname. Then, create a structure named Person with three (3) members. The members include fullname type Name, age type integer and citizen type integer. Store 50 input data in an array named P of type Person. Print out a list of persons who have age greater than or equal 21 years old. Note: Please write C ++ statements WITHOUT blank spaces unless it is absolutely needed. Example: int num,a,b;

#include  #include  using namespace std;  int main() {  /*a) Declare structure named Name with 2 members of type char array named firstname and lastname with size 30 (3 marks)*/ Answer { Answer; Answer;  };   /*b) Declare structure named Person with 2 members of type integer named age and citizen, and one member of type Name named fullname (4 marks)*/ Answer { Answer; Answer; Answer; };   const int SIZE = 50;   /*c) Define array named P of type Person with size 50. Note: use the declared SIZE constant (2 marks) Answer;   //Get input data  cout  cout   cout > Answer; cout > Answer;  }  cout  for (int i = 0; i  /*h) Display firstname, lastname and citizen for the person who age 21 or more (5 marks)*/ if (Answer) cout  }   return 0; } 

this is a c++ question...please help...urgent Complete the following program with appropriateC++ statements. This program stores the information of 50 Persons using structures.Declare a structure to represent a name with two (2) members oftype char array with size 30 named firstname and lastname. Then, create

1 2 #include #include using namespace std; 3 4 5 6 int main() { /*a) Declare structure named Name with 2 members of type char array named firstname and lastname with size 30 (3 marks)*/ 17 8 19 { 10 11 12 13 14 15 }; 16 17 18 /*b) Declare structure named Person with 2 members of type integer named age and citizen, and one member of type Name named fullname (4 marks)*/ 19 20 { 21 22 3 23 24 ; 25 26 ; 27 28 }; 29 30 const int SIZE = 50; 31 32 /*c) Define array named P of type Person with size 50. Note: use the declared SIZE constant (2 marks) 33 ; 34 35 36 37 1/Get input data cout > 54 55 56 cout > 59 60 } 61 62 63 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!