Home / Expert Answers / Computer Science / task-11-1-hunters-hit-list-in-this-task-you-need-to-declare-an-enumeration-and-a-structure-a-pa363

(Solved): Task 11.1 Hunters Hit List In this task you need to declare an enumeration and a structure, a ...



Task 11.1 – Hunter’s Hit List In this task you need to declare an enumeration and a structure, as well as create functions to work with these new types you have created. Declare an enumeration for difficulty, there are three kinds of difficulty (difficulty kind): Normal difficulty, Hard difficulty, and Insane difficulty. This program will use a structure (target _animal) to store and work with the hits. Each target _animal has a name (a string), an hit id (an integer), a difficulty (a difficulty kind), and a value (an integer). The program must include the following: • A read_difficulty function that asks the user to select a Difficulty Kind, validates the user's data entry, and then returns the entered Difficulty Kind. • A read_target_animal function that reads in the hit data from the user and returns it to the calling code as a target_animal value. It must ensure that the value is 0 or larger, asking the user to re-enter the value while not valid. • An add_ target_animal that call read_target_animal to add a new target_animal. Hint: you need to extend the memory dynamically to add new data. • A print_target_animal function that accepts a target_animal parameter and prints the details of this hit to the terminal in the format ‘difficulty: target (hit id) $value’ followed by ‘small animal’ if the value is less than 1000, or ‘large animal’ if value is larger than 1000. • most_valuable_target – to print the highest valuable target for a particular kind. In main function perform the following steps Create a menu that allows the user to: 1. Add target_animal 2. Print all target_animal 3. Print the highest value for a kind 4. Quit



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe