Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ help! It should have base class(space abstruct class) that uses virtual function, and 5 space classes(derived classes). Each class should have 4 pointer variables.

C++ help!

image text in transcribedimage text in transcribedimage text in transcribed

It should have base class(space abstruct class) that uses virtual function, and 5 space classes(derived classes). Each class should have 4 pointer variables. Please do it in separate cpp and hpp files.

Goals- Design a program to satisfy provided requirements Use good OOP style including inheritance, polymorphism, and pointers You will design and implement a text-based game or puzzle where the plaver moves through a series of rooms or compartments. They will need to gather items to achieve some purpose. The details are left to you! Specific requirements. You will create a series of rooms or compartments or spaces for the player to move through. For simplicity I will call them spaces, as they do not need to be a physical compartment. Each space will be a class with (at least) four pointer variables that link to other spaces. Even if your structure is linear, such as a train, you will still have four pointer variables in the class. Be creative and try to use them all! You might consider secret passages or "stepping" outside the train? The space will also have appropriate data members. You must have at least 5 spaces of at least 3 different types. NOTE: The requirement for four pointers in each room/compartment is to simplify coding. If you need more pointers for your theme, feel free to add more. You will have a space abstract class that will have a special pure virtual function. Each type of space will have a special action. It could be the controls in the engine, or to control access to one of the doors (pointers), or it could simply turn on the lights You will have at least 3 derived classes for different types of spaces. To continue with the train theme you could have a passenger car, or baggage car. Or one space could have controls such as the engine You must have a goal for the player. Maybe it is to solve a crime (like Clue?). Maybe the aliens have invaded your spaceship and normal weapons do not work but broccoli causes them to leave! Based on your theme the player must discover the solution. You may have a random goal. One tme broccoli works, next time it is a pllow

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago