Cis247 final exam 1 100% correct answers

Page 1

CIS247 Final Exam 1 100% Correct Answers

Download here: http://homeworkfox.com/tutorials/computer-science/11818/cis247-fin


Create the necessary attributes, accessor and mutator methods, a print function, and a constructor WITH arguments Note: Create the class person.h and person.cpp only - you don't need the main.cpp Note: You do not need to include the dateType class in your answer just show me how you would use an object of the dateType class in your person class. (Points : 18) 3. Create a class called Child that inherits from the person class from the previous question. Aside from entering a child's name, age and bithday using the person class. The Child class should allow for entering what grade the child is in and the child's gender. Create the necessary attributes, accessors, mutators, print function, and a constructor WITH arguments. 1. Create a class called parent that inherits from the person class - aside from setting the adult's name, age and birthday using the person class - you should also be able to set the parent's occupation, spouse's name, whether they are mom or dad, and the number of children they have. Create the necessary attributes, accessors, mutators, print function, and a constructor WITH arguments. Note: Create adult.h and adult.cpp only - not the main.cpp (Points : 18) 1. Create a class called simpleMath - this class should have two int attributes and accessor and mutator methods to set and get those two int attributes - and a calcSum method that returns the sum of the two ints, a calcDifference method that returns the difference of the two ints, a calcProduct method that returns the product of the two ints, and a calcDivision method that returns the division result of the two ints. Also make sure to create a constructor WITH arguments. (The order of a/b or b/2 , a-b, b-a, is up to you) Note: Just need to create the simpleMath.h and simpleMath.cpp files not main.cpp (Points : 18) 6. Create a class called Coin with one string attribute. Create the proper accessor/mutator methods for the attribute. Create a constructor that takes no arguments that sets the string to "Unknown" Create a method that returns the numeric value of the coin string name. For example: .25 should be returned if the string attribute holds "Quarter" .05 should be returned if the string attribute holds "Nickel" etc. Note: Just write out Coin.h and Coin.cpp - no need for main.cpp (Points : 18) 7. Put the person, child, and the parent classes together - keep in mind that person also has a composition with a dateType object. (You don't need dateType.h and dateType.cpp in your answer here but might need it if you want to compile this in visual studio) Edit your classes 1) Make the print function in the person class a pure virtual function - which makes person class an abstract class


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.