#include using namespace std; class Game {     public:     Game() {         cout <<"Game Started"<

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question
Question is in the image
 
 
#include <iostream>
using namespace std;

class Game
{
    public:
    Game() {
        cout <<"Game Started"<<endl;
    }
    //destructor goes here
   
};

class Quiz: public Game
{
    public:
    Quiz() {
        cout <<"Quiz Started"<<endl;
    }
    //destructor goes here
   
};

int main() {
    Quiz q;
}
 
You are making a Quiz game. The Quiz class inherits from the Game base class.
Both classes have constructors, which output a Start message.
Create destructors for each class, which will output "Game Over" in the Game class,
and "Quiz Over" in the Quiz class, so that when the program executes, it outputs:
Game Started
Quiz Started
Quiz Over
Game Over
Transcribed Image Text:You are making a Quiz game. The Quiz class inherits from the Game base class. Both classes have constructors, which output a Start message. Create destructors for each class, which will output "Game Over" in the Game class, and "Quiz Over" in the Quiz class, so that when the program executes, it outputs: Game Started Quiz Started Quiz Over Game Over
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage