Question: 2-2. Define and implement a class named aircraft. An aircraft object represents an aircraft with a pilot and a co-pilot. The pilot and co-pilot must
2-2. Define and implement a class named aircraft. An aircraft object represents an aircraft with a pilot and a co-pilot. The pilot and co-pilot must be represented by person objects. The aircraft class has the following constructors and behaviours: // a pilot and copilot must be provided when creating an aircraft sircraft(string callsign,person thePilot,person theCoPilot) void setPilot(person thePilot)change the pilot person getPilot() void setcoPilot(person theCoPilot); change the co-pilot person getCoPilot); void printDetails // print the callsign, ? new line, the pilot nare, //a new line, the co-pilot nare and a final newline Your main program should create an aircraft object and three person objects. Two of the person objects must be passed to the constructor when the aircraft object is created. Your main program must then replace the pilot with the third person object, then replace the co-pilot with the original pilot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
