C-Visual-studios-Structs

C-Visual-studios-Structs

Using Structs

The 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 player

Max Health – The amount of HP a gladiator will start each fight with

Current Health – The amount of HP a gladiator has left before they have lost the fight

Evasion – The % chance (0-100) that the gladiator will completely avoid incoming damage

Critical – 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 attack

Damage Range – The most damage ABOVE Minimum Damage that the gladiator can inflict with a single, non-critical hit

Write a program that performs the following:

  1. Tell the user that they are going to be hosting a fight! But first, we need to…
  2. Prompt the user for a name, which is then sent to the createGladiator(string) function
    1. createGladiator should return a gladiator, after randomly generating them according to the following rules:
      1. Max Health should be 150, 200, or 250
      2. Evasion and Crit should be two independent values chosen from 5, 7.5, 10, 12.5, or 15%
        1. You may use numbers like 50 or 75 to represent the percentages for calculations, or alter your randomly generated values
      3. Minimum Damage should be in the range 8-14, with Damage Range in the range 16-22
    2. After 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.
  3. Repeat step 2 once to obtain the second gladiator for your fight
  4. Once 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. Crits and misses should both be reported. (A and B provided only for illustration purposes)
  5. Ask the user if they would like a rematch with the same fighters. If so, go to step 4.
  6. Ask the user if they would like to set up another fight. If so, go to step 2.

Menu input should accept either a single lowercase char or an integer, prompts should tell user what to enter.

Points:

2 – Documentation, readability, format

2 – Filename and Header

1 – Output testing

2 – Proper program flow (conditions, loops, functions, etc)

3 – Proper use of structs

Header

//Author: Eric May (your name)

//CPSC 121 Lab 8

//<MM/DD/YY> (Current Date)

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational