Solved by verified expert:Using StructsThe following program is going to revolve around creating and using the “Gladiator” struct, which will contain statistics about their performance in combat. Gladiators have some information:Name – How they’re referenced to the player, provided by the playerMax Health – The amount of HP a gladiator will start each fight withCurrent Health – The amount of HP a gladiator has left before they have lost the fightEvasion – The % chance (0-100) that the gladiator will completely avoid incoming damage when defendingCritical – The % chance (0-100) that the gladiator will inflict twice the rolled damage when attacking the opponent (known as a crit)Minimum Damage – The lowest amount of damage a gladiator can inflict with a successful attackDamage Range – The most damage ABOVE Minimum Damage that the gladiator can inflict with a single, non-critical hitE.X. Min 30, range 50 would result in damage between 30-80See end of Chapter 8 slidesstruct gladiator { … };Write a program that performs the following:Tell the user that they are going to be hosting a fight! But first, we need to…Prompt the user for a name, which is then sent to the createGladiator(string) functioncreateGladiator should return a gladiator, after randomly generating them according to the following rules:Max Health should be 150, 200, or 250Evasion and Crit should be two independent values chosen from 5, 10, or 15%Minimum Damage should be in the range 8-14, with Damage Range in the range 16-22After stats have been assigned in createGladiator, show the user the stats that were created or loaded using a showStats(gladiator) function, then ask the user if they wish to accept or reject their fighter before the function ends. If they reject the fighter, generate a new set of stats, with the same rules listed under 2.a, under the same name.Repeat step 2 once to obtain the second gladiator for your fightOnce both fighters are obtained, they will take turns (starting with the first fighter) using the takeTurn(gladiator A, gladiator &B) function to attack each other. An attack by fighter A will reduce fighter B’s current health by the amount of attack damage. (Why is B a reference variable?) Crits and misses should both be reported. (A and B provided only for illustration purposes)Once one of the fighters have their health reduced to 0 or below, they have been defeated. Tell the user about who won the fight, along with any combat statistics you would like to track.Ask the user if they would like a rematch with the same fighters. If so, go to step 4.Ask the user if they would like to set up another fight with new fighters. If so, go to step 2Extra Credit: Include the option in createGladiator to load an existing gladiator from a file, as well as an option to save the victor of any given fight to a file. A hard-coded or user-input filename are both acceptableMenu input should accept either a single lowercase char or an integer, prompts should tell user what to enter.Points:2 – Documentation, readability, format2 – Filename and Header1 – Output testing2 – Proper program flow (conditions, loops, functions, etc)3 – Proper use of structsHeader//Author: Eric May (your name)//CPSC 121 Lab 7//
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more