This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Spring 2009 CS 31 Project 7 Warmup P Virtual Pets To help ease you into the world of classes you'll need for Project 7, we've designed these warmup exercises. (You will not turn in any of the code you write because of these warmups.) Did you have a Tamagotchi or Gigapet when you were young? Here's your chance to implement a very simple one. This program compiles and runs, but does not produce the output it should, because the implementations of the member functions are incomplete or incorrect. Fix them so that the program produces the desired output. The places to make a change are denoted by TODO comments. You must make no changes whatsoever to the reportStatus , careFor , or main functions. There are a few features used here we haven't talked about yet, but Chapter 6 discusses them, and we'll talk about them in discussion and in class. After you get everything working, try the each of the following experiments to test your understanding of some of concepts: Try declaring the health member function private instead of public, and make sure you understand the resulting compilation error....
View Full Document
- Spring '00