Question
The television series Game of Thrones features several Great Houses, each with several characteristics, including the name of the house, its sigil (i.e., symbol), its
-
The television series Game of Thrones features several Great Houses, each with several characteristics, including the name of the house, its sigil (i.e., symbol), its motto and the name of its current head of the house.
-
Create a class to represent such a Great House, based on the following instructions:
-
The state of the class must include the four characteristics mentioned above.
-
The class must provide a single constructor that takes values for all four characteristics.
-
The class must provide function(s) to retrieve all characteristics of a House.
-
The class must provide function(s) to update the name of the current head of the House.
-
-
Write a driver/main function to demonstrate the class created above. In this main function, do the following:
-
Create an object to represent House Lannister. The name of this house is obviously Lannister, its sigil is a Lion, its motto is Hear me roar!. Assume that the current head of the House is Tywin Lannister.
-
Retrieve and display all the characteristics of House Lannister.
-
Tywin Lannister is killed! The new head of House Lannister is now Jamie Lannister. Update the state of the above object to reflect this change.
-
Retrieve and display all the characteristics of House Lannister.
-
-
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started