/** Copyright and version declaration section of the Program * Copyright (c) 2012, student * All rightsreserved from computer College of Yantai University. * Author: Li Yang * Completion Date: July 15, May 24, 2013 * version: v1.0 * input Description: none * Problem description: none * program output: none */# include <iostream> using namespace std; class StudentA // (1) modify the access qualifier of each data member and member function in the studentA class, and observe the phenomenon {public: StudentA (int n, string nam, char s); void showA ();~ StudentA () {} private: int num; string name; char sex;}; StudentA: StudentA (int n, string nam, char s) {num = n; name = nam; sex = s;} void StudentA: showA () {cout <"num:" <num <endl; cout <"name: "<name <endl; cout <" sex: "<sex <endl;} class StudentB: private StudentA // (2) modify the inheritance method, and observe the phenomenon {public: StudentB (int n, string nam, char s, int a, string ad); void showB ();~ StudentB () {} private: int age; string addr;}; StudentB: StudentB (int n, string nam, char s, int a, string ad): StudentA (n, nam, s) {age = a; addr = ad;} void StudentB: showB () {showA (); cout <"age:" <age <endl; cout <"address:" <addr <endl;} int main () // (3) Think about the change of access Qualifier and inheritance method, what will happen and explain {StudentB stud1 (10010, "Wang-li", 'F', 19, "115 Beijing Road, Shanghai "); studentB stud2 (10011, "Zhang-fun", 'M', 21, "213 Shanghai Road, Beijing"); StudentA stud3 (20010, "He-xin ", 'M'); stud1.showB (); stud2.showB (); stud3.showA (); return 0 ;}