ECE287 Digital Systems Design
The base class Pet has protected data members petName, and petAge. The derived class Cat extends the Pet class and includes a private data member for catBreed. Complete main() to:
create a generic pet and print information using PrintInfo().
create a Cat pet, use PrintInfo() to print information, and add a statement to print the cat's breed using the GetBreed() function.
Ex. If the input is:
Dobby
2
Kreacher
3
Scottish Fold
the output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: Scottish Fold
Given main(), define a Course base class with functions to set and get the private data members of the following types:
string to store the course number
string to store the course title
Define Course's PrintInfo() function that outputs the course number and title.
Then, define a derived class OfferedCourse with functions to set and get the private data members of the following types:
string to store the instructor name
string to store the location
string class time
Ex. If the input is:
ECE287
Digital Systems Design
ECE387
Embedded Systems Design
Mark Patterson
Wilson Hall 231
WF: 2-3:30 pm
the output is:
Course Information:
Course Number: ECE287
Course Title: Digital Systems Design
Course Information:
Course Number: ECE387
Course Title: Embedded Systems Design
Instructor Name: Mark Patterson
Location: Wilson Hall 231
Class Time: WF: 2-3:30 pm
Given main() and a base Book class, define a derived class called Encyclopedia with member functions to get and set private class data members of the following types:
string to store the edition
int to store the number of pages
Within the derived Encyclopedia class, define a PrintInfo() member function that overrides the Book class' PrintInfo() function by printing the title, author, publisher, publication date, edition, and number of pages.
Ex. If the input is:
The Hobbit
J. R. R. Tolkien
George Allen & Unwin
21 September 1937
The Illustrated Encyclopedia of the Universe
Ian Ridpath
Watson-Guptill
2001
2nd
384
the output is:
Book Information:
Book Title: The Hobbit
Author: J. R. R. Tolkien
Publisher: George Allen & Unwin
Publication Date: 21 September 1937
Book Information:
Book Title: The Illustrated Encyclopedia of the Universe
Author: Ian Ridpath
Publisher: Watson-Guptill
Publication Date: 2001
Edition: 2nd
Number of Pages: 384