Create a default constructor to initialize the variables
In C++ Create a class Person, which has a name, address, city, state, zip, and phone number. Create a default constructor to initialize the variables to some default values. DO NOT get them as an input from the user. If you prefer non-default constructors, then you can have them, but that is optional. Have a "display()" function to display the values.
Create a class Student, which inherits from Person, and has additionally grade, course, and GPA. Create a default constructor to initialize the three variables to some default values. DO NOT get them as an input from the user. If you prefer non-default constructors, then you can have them, but that is optional. Have a "display()" function to display the values. From the Student "display()" function call the Person "display()" function.
In the "main()", create an object of Person. Display its values. Then, create an object of Student. Display its values. This would display all the variables from both Person and Student.
Add plenty of narrative comments.
Answers
Status NEW
Posted 15 May 2017 10:05 AM
My Price 10.00
-----------
Attachments
file 1494843149-Answer.docx preview (550 words )
I-----------n C-----------++ -----------Cre-----------ate----------- a -----------cla-----------ss -----------Per-----------son-----------, w-----------hic-----------h h-----------as -----------a n-----------ame-----------, a-----------ddr-----------ess-----------, c-----------ity-----------, s-----------tat-----------e, -----------zip-----------, a-----------nd -----------pho-----------ne -----------num-----------ber-----------. C-----------rea-----------te -----------a d-----------efa-----------ult----------- co-----------nst-----------ruc-----------tor----------- to----------- in-----------iti-----------ali-----------ze -----------the----------- va-----------ria-----------ble-----------s t-----------o s-----------ome----------- de-----------fau-----------lt -----------val-----------ues-----------. D-----------O N-----------OT -----------get----------- th-----------em -----------as -----------an -----------inp-----------ut -----------fro-----------m t-----------he -----------use-----------r. -----------If -----------you----------- pr-----------efe-----------r n-----------on------------def-----------aul-----------t c-----------ons-----------tru-----------cto-----------rs,----------- th-----------en -----------you----------- ca-----------n h-----------ave----------- th-----------em,----------- bu-----------t t-----------hat----------- is----------- op-----------tio-----------nal-----------. H-----------ave----------- a -----------&qu-----------ot;-----------dis-----------pla-----------y()-----------&qu-----------ot;----------- fu-----------nct-----------ion----------- to----------- di-----------spl-----------ay -----------the----------- va-----------lue-----------s. ----------- Cr-----------eat-----------e a----------- cl-----------ass----------- St-----------ude-----------nt,----------- wh-----------ich----------- in-----------her-----------its----------- fr-----------om -----------Per-----------son-----------, a-----------nd -----------has----------- ad-----------dit-----------ion-----------all-----------y
Not Rated(0)