Lab7Questions.pdf - CSE-165-Lab 7 100 Points Write a...

This preview shows page 1 - 2 out of 4 pages.

CSE-165-Lab 7100 PointsWrite a separate .cpp file for each of the following tasks. For eachquestion try to come up with various test cases to test your code. Youmay be evaluated based on test cases provided during demo.1.References in C++(5 Points)Study the file refs.cpp. It makes use of a function named triple whichreturns a number multiplied by three. Provide this function in a filenamed refs.h.Sample output from refs.cppEnter a number: 5152.Polymorphism in C++ (5 points)Study the files catsDogs.cpp, Cat.h, Dog.h and Animal.h. The programdoes not compile in its current form. A piece of code is missing fromAnimal.h. Add that code and submit the new Animal.h.Sample output from catsDogs.cppWoof, woof!Meow, meow!3.Copy Constructors (10 Points)Get the file objects.cpp. It instantiates some Object classes and printsout the value of the count variable, which simply keeps track of howmany instances of Object have been created.

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 4 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Cheng,Yu
Tags
Object Oriented Programming, Subroutine, AppWindow

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture