CP Lab 7.docx - FAST – NU, CFD Campus National University...

This preview shows page 1 - 3 out of 5 pages.

National University of Computer andEmerging SciencesLaboratory ExerciseComputer Programming LabSpring 2018Lab # 7Department of Computer ScienceFAST – NU, CFD CampusPage 1FAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD CampusFAST – NU, CFD Campus
ObjectivesCLASSESCONSTRUCTORS - DESTRUCTORSPARAMETRIZED CONSTRUCTOROBJECTS AND FUNCTIONSSTATIC AND CONSTANTNote: Carefully read the following instructions.1.Make a word document with the convention “ROLLNO_SECTION_LABNO” and putall your C++ source code in it.2.After every question paste a screenshot of your working code below the source codein the document file.3.At the end, when you are done with your lab tasks, make your submission on slate.Problem 1:(DMA, constructor, destructor, accessors and mutator functions, constructoroverloading, copy constructor, const method, Deep copy)Write a class student with following data members and methods;Private Member VariablesVariable DescriptionfirstNameA char pointer that hold the first name of employeelastNameA char pointer that hold the last name of employeecountA static variable count that count the total number ofemployeesPublic Member FunctionsFunction DescriptionDefault Constructorinitialize all member variables with null valueOverloaded Constructoraccepts two constant char pointers and initialize firstand last name, it also increments the counter, count++;Copy constructorIt copy one object into other using deep copyDestructorIt release all dynamically allocated memory of that objectwith proper messagegetFirstName constmethod that return first name usingthis pointergetLastName constmethod that return last name usingthis pointergetCount

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Sarim baig
Tags
Method, Subroutine, CFD Campus

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture