Question: please use the first 4 pictures program ( c + + ) to make it function like the 5 th picture considering these specifications: Specifications
please use the first pictures programc to make it function like the th picture considering these specifications:
Specifications
Add a new member to the GamePlayer structure which will be a string weapon to represent
the weapon that each player will use in the game
Create an array with a size of that will contain the available weapons to choose from. Set the
weapon choices to : Axe, Knife, Bow, Wand
Create a function called setweapons that will receive a vector of GamePlayer type in its
parameter. For this function:
Request the player number which will represent the player choosing a weapon. Make sure
the player number is valid, otherwise show an error message see console example for
reference
After receiving a valid player number display to the user all the weapons available.
Then, request the weapon name which will represent the weapon that the player will be
choosing. Make sure the weapon name is valid, otherwise show an error message see console
example for reference
After receiving a valid weapon name, save its weapon choice for the player selected and
display an appropriate message to the screen. see console example for reference
Finally call the addweaponstofile function in order to save the weapon choice for the
player on the weapons.txt file.
Create a function called addweaponstofile that will receive a vector of GamePlayer type,
and an int playerindex variable in its function parameters. For this function:
Write to a weapons.txt file in append mode that has the following format separated by tab
characters: Name of the player Occupation Weapon of choice see file example for
reference
After writing the new entry to the file, display an appropriate message to the screen see
console example for reference
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
