Functional decomposition implementation of the algorithm


You will be writing a text-based role playing game. The game will include the following:

- A main menu from which the user will choose:

1) See Rules

2) Play Game

3) Quit-

If the user chooses to play the game, menus will be shown from which the user willchoose his/her character and weapon. The course of the game will depend upon theuser's choices.The following menu will be displayed for the user to select a character:

1) Human

2) Ogre

3) ElfNext,

you will display the following menu from which the user will choose a weapon:

1) Flame Thrower

2) Bow and Arrow

3) Magic Potion

- A score will be kept throughout the game based on the user's selections.

You will assign the following point values, but the user will not know these values:Human - 100Ogre - 200Elf - 300If the user chooses Flame Thrower or Bow and Arrow, a practice session will start in whichthe computer will randomly generate a number from 1 - 4, which will determine whattarget is hit.

Assign the following point values:

1 - Target A is hit, worth 100 points2 - Target B is hit, worth 200 points3 - Target C is hit, worth 300 points4 - No target is hit, 0 pointsIf the user chooses Magic, he/she will try to make a potion. The computer will randomlygenerate a number from 0 - 1 to determine if the potion is successful.If the potion is a success, 200 points will be awarded, if it fails, 100 points will be deducted from the score.

- At the end of the game, display the user's score on the screen.

- You will also have a high score file called "highscore.txt" that contains a name and ascore.At the end of the game, read in the score stored in "highscore.txt".

o If the file does not exist, create one with the current player as the high score (name &score)

o If the user has scored higher than the value in the file, replace the value in the text filewith the current player's name and score. Otherwise, do not change the text file.

- The user should be able to play as many times as he/she wishes.Have fun and be creative!!

Notes about Functionality, Implementation & Program Requirements:

1. The program should validate the information entered by the user and display theappropriate error messages.

2. The code should be self-documented, including:

- Descriptive Comment indicating- Author- Program Summary- IPO Chart

- Appropriate comments throughout the code that highlight, among other things, the implementation of the algorithm.

- Adequate use of spaces and indentation so the source code is easy to readwhen printed out.

3. Functional decomposition implementation of the algorithm. Must define at least four different functions. Make sure to include functions that exemplify void vs. return-type,and value vs. reference parameters

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Functional decomposition implementation of the algorithm
Reference No:- TGS01481332

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)