for c++ need 3 files please all three files (character.h, castle.h, 81.cpp)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

for c++ need 3 files please

all three files (character.h, castle.h, 81.cpp)

  • you have been asked by a computer gaming company to create a role-playing game, commonly known as an rpg.
  • the theme of this game will be of the user trying to get a treasure that is being guarded
  • the user will choose a character from a list you create
  • create a character class, in a file named character.h, which will:
  • have the following variables:
  • name
  • race (chosen from a list that you create, like knight, wizard, elf, etc.)
  • weapon (chosen from a list that you create)
  • spells (true meaning has the power to cast spells on others)
  • anything else you want to add
  • the treasure will be hidden in one of the rooms in a castle
  • create a castle class, in a file named castle.h, that will:
  • have these variables:
  • at least four rooms named room1, room2, etc.
  • moat (which is a lagoon surrounding a castle) which boolean (not all castles have them)
  • anything else you want to add
  • create a default constructor for each class that initializes each argument to a blank or false value
  • create a second constructor for each class that assigns arguments passed to it to these variables
  • create the appropriate mutator functions for each class
  • create the appropriate accessor functions for each class
  • in the main program, named 81.cpp:
  • declare all the necessary variables using appropriate data types
  • display a welcome message
  • create two players, using each of the character constructers once
  • create one castle castle using either one of the castle constructors
  • display all of the information for player1 and ask if the information is correct
  • if the answer is 'no', then have the user tell you which item(s) need fixing and give them a chance to re-input the incorrect value
  • do the same thing for player2 and for your castle
  • to control the action of the game, you will use a virtual die that will be 'rolled'
  • roll the die to determine which room in the castle the treasure will be hidden in
  • use random number generator to generate a random number between 1 and 4 (more if you have more than 4 rooms)
  • roll the die to determine who will be guarding the treasure (minimum of 1 to 4; have a different type of character in each room-you decide on the type of character)
  • display the result of the two rolls, ie: "the treasure is hidden in the dungeon and is being guarded by a wizard."
  • display additional info to the effect that the castle does (or doesn't) have a moat, and the castle gate is guarded by an <you decide what character>.
  • In order to enter the castle, the user must answer a question about C++, which you will display, along with the possible answers.
  • if the user answers correctly, display a message that they've defeated the <character> and are inside the castle.
  • then, have the user go to the room where the treasure is hidden, and ask the creature to answer another question about C++.
  • use the random number generator to generate a number between 1 and the number of possible answers (if it's a true/false question, it's 2 possible answers) to 'choose' the answer
  • use a conditional structure to determine if the character choose the correct answer (ie: if chose 1 and your program assigns 'true' to that number, and true is the correct answer)
  • if the guard chooses correctly, it has defeated you
  • if the guard chooses incorrectly, you have defeated it
  • display a message telling the user who has been defeated, and ask if they want to play again
  • if yes, send the user back to the beginning of the program
  • if no, say thanks for playing
  • submit all three files (character.h, castle.h, 81.cpp)
  • you may add things to your program that are not listed here
  • creativity is encouraged!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 10 images

Blurred answer
Knowledge Booster
Array
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education