+ 1

You are making a Quiz game. The Quiz class inherits from the Game base class.

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 https://code.sololearn.com/cnL62ASjqajQ/?ref=app

12th Aug 2022, 5:46 AM
Ilakkya G
Ilakkya G - avatar
9 Answers
+ 7
Is it a sololearn task? Make sure that your output strings are spelled exactly as described in the task: "Game Started", not "GameStarted", "Game Over", not "Game over"...
12th Aug 2022, 6:48 AM
Lisa
Lisa - avatar
+ 1
Ilakkya you should mark Lisa 's answer as best. She solved your problem.😎
12th Aug 2022, 11:03 AM
Bob_Li
Bob_Li - avatar
0
This is the crt code I have typed..but I get error..Please do let me know abt my mistake
12th Aug 2022, 5:55 AM
Ilakkya G
Ilakkya G - avatar
0
Lisa hi mam ..can u help me?
12th Aug 2022, 6:01 AM
Ilakkya G
Ilakkya G - avatar
0
Jay Matthews can u help me with my code?
12th Aug 2022, 6:10 AM
Ilakkya G
Ilakkya G - avatar
0
Lisa ok mam..will try it and let u know! Thanku
12th Aug 2022, 6:49 AM
Ilakkya G
Ilakkya G - avatar
0
i write this code no changes only for the GameStarted and all but i got a timeout error, anyone experience the same?
16th Nov 2022, 9:47 AM
Rachel Pangemanan
0
#include <iostream> using namespace std; class Game { public: Game() { cout<<"GameStarted"<<endl; } ~Game(){ cout<<"Game over"<<endl; } }; class Quiz: public Game { public: Quiz() { cout<<"QuizStarted"<<endl; } ~Quiz(){ cout<<"Quiz Over"<<endl; } }; int main() { Quiz q; }
19th Jan 2023, 5:32 PM
Hamdu Ali
Hamdu Ali - avatar
0
#include <iostream> using namespace std; class Game { public: Game() { cout<<"GameStarted"<<endl; } ~Game(){ cout<<"Game over"<<endl; } }; class Quiz: public Game { public: Quiz() { cout<<"QuizStarted"<<endl; } ~Quiz(){ cout<<"Quiz Over"<<endl; } }; int main() { Quiz q; }
19th Jan 2023, 5:32 PM
Hamdu Ali
Hamdu Ali - avatar