For the first checkpoint, you will be working in groups of 4 to design the Animal.h file
Fantastic news! We've Found the answer you've been seeking!
Question:
For the first checkpoint, you will be working in groups of 4 to design the Animal.h file for a new class. Keep in mind that you should only put the class defintion in the header file, you are not writing the actual implementation. Make sure that everyone in the group participates and understands the material - it is possible that all of you will have to answer questions to get checked off! Each instance of the Animal class will describe several characteristics about an animal. Every Animal must have a name at all times. This is the only value that will be passed in when a new object is declared. It should be possible to set the weight of the animal, if the animal can survive on land, if the animal can survive in water, if the animal eats meat, and if the animal eats plants. All of these values (including the name) should be accessible from outside the class as well. In addition, the class should be able to indicate if the animal in question is an omnivore (eats both meat and plants) and if they are amphibious (can survive on land and in water). Make sure to explain the purpose of every function with a comment. Consider the return type, whether each argument should be passed by value, reference, or constant reference, and whether or not the function is a constant member function (has const after the argument list). Be prepared to justify your choices. To get checked off, show your completed header file and answer any questions asked by the TA/mentor. NOTE: The rest of the lab should be alone, only Checkpoint 1 is a team exercise. For the rest of this lab, you will implement a simple C+ + class named Time. It represents all possible times in a 24-hour period, including hours, minutes and seconds. An immediate representation issue is how to handle morning (am) and afternoon (pm) times. We could have a separate bool indicating whether the time is am or pm. It is easier, however, to represent the hours in military time. This means that the hours of the day are numbered from 0 to 23, with 13 being 1 pm, 14 being 2 pm, etc. Your notes from Lecture 3 with the example Date class will be helpful in completing this lab.
Related Book For
Business Communication In Person, In Print, Online
ISBN: 978-1111533168
8th edition
Authors: Amy Newman, Scot Ober
Posted Date: