Question: QUESTION 3 ( 1 5 marks ) A . Given a struct called Person that has two data members' citizenship and age, write the C

QUESTION 3(15 marks)
A. Given a struct called Person that has two data members' citizenship and age, write the C++ code that would create a struct variable p1 of type Person. Assign a country to the citizenship data member and assign an age to the age data member then display both data members to the screen. [5 Marks]B. Given the following UML Class Diagram, write the class declaration and definition code. In the main() function instantiate two objects of this class, one using the default constructor and the other using the parameterized constructor. Call the displayAeroplane() function on the object created with the parameterized constructor. [10 Marks]
\table[[Aeroplane],[-model: string],[-seats:int],[+Aeroplane()],[+Aeroplane(m:string, s: int)],[+setModel(m:string) : void],[+setSeats(s:int) : void],[+getModel() : string],[+getSeats() : int],[+displayAeroplane() : void]]
QUESTION 3 ( 1 5 marks ) A . Given a struct

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 Programming Questions!