CS 160 - Programming Concepts and Applications

Summer II 2018 - Lab 7B - Godzilla Holiday Greeting

Quick Links: Canvas | John Cabot | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |

This lab is due by Friday, August 3, 2018, 11:59 PM.


Concepts



We will extend the Godzilla class from the prior lab.


Godzilla Class



Add the following function to your class:
  • A greet function that accepts another Godzilla object as a parameter which is passed by constant reference. That is, the parameter should be marked constant so that the function cannot inadvertantly change the target's values. The function should print out a message in the form of "Callee's Name bows to Target's Name."
Now in main before the two Godzillas do battle, have Godzilla greet Mechagodzilla. As in, the code would look like

godzilla.greet( mechaGodzilla );

In order for this to work, you will need to make sure that you have marked ALL of your functions as const or not appropriately. Which functions should be constant functions? Which parameters should be constant parameters?


Lab Submission



You will submit your solution to this lab with the rest of Set7. Detailed instructions for doing this are posted in Assignment 7.


This lab is due by Friday, August 3, 2018, 11:59 PM.

Last Updated: 06/06/18 22:49


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0