CSCI 261 - Programming Concepts

Spring 2019 - Lab 8E - Cordial Godzilla vs. MechaGodzilla

Quick Links: Canvas | Mines | Piazza | zyBooks

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

This lab is due by Tuesday, April 30, 2019, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.


Concepts



Focus on expanding the Godzilla class from Lab8D.


Suggestion: Use NotePad or WordPad



Consider using NotePad or WordPad on your computer to write your code for this lab. Once you feel good about what you've written, then copy the code into your project. Doing this will help you see where you might make mistakes on the exam!

You should write a main.cpp that tests each feature of your class works as expected. You will need to submit your class declaration file, your class definition file, and your main.cpp file for this lab.


The Final Godzilla Class



Now 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."
Finally, 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? Do this for every function - denote it as a const function when it is not modifying and of the callee's data members. Likewise, mark any parameters in every function as const that are not modified within the function body.


Lab Submission



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


This lab is due by Tuesday, April 30, 2019, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.

Last Updated: 11/09/18 19:33


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