+ 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
9 Antworten
+ 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"...
0
This is the crt code I have typed..but I get error..Please do let me know abt my mistake
0
Lisa hi mam ..can u help me?
0
Jay Matthews can u help me with my code?
0
Lisa ok mam..will try it and let u know! Thanku
0
i write this code no changes only for the GameStarted and all but i got a timeout error, anyone experience the same?
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;
}
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;
}