Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 1 1 . 1 Hunter s Hit List In this task you need to declare an enumeration and a structure, as well as create
Task Hunters 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 readdifficulty function that asks the user to select a Difficulty Kind, validates the user's data entry, and then returns the entered Difficulty Kind. A readtargetanimal function that reads in the hit data from the user and returns it to the calling code as a targetanimal value. It must ensure that the value is or larger, asking the user to reenter the value while not valid. An add targetanimal that call readtargetanimal to add a new targetanimal. Hint: you need to extend the memory dynamically to add new data. A printtargetanimal function that accepts a targetanimal 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 or large animal if value is larger than mostvaluabletarget 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: Add targetanimal Print all targetanimal Print the highest value for a kind Quit
Task Hunters 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 readdifficulty function that asks the user to select a Difficulty Kind, validates the user's
data entry, and then returns the entered Difficulty Kind.
A readtargetanimal function that reads in the hit data from the user and returns it to the
calling code as a targetanimal value. It must ensure that the value is or larger, asking the
user to reenter the value while not valid.
An add targetanimal that call readtargetanimal to add a new targetanimal. Hint: you
need to extend the memory dynamically to add new data.
A printtargetanimal function that accepts a targetanimal 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 or large animal if value is larger than
mostvaluabletarget 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:
Add targetanimal
Print all targetanimal
Print the highest value for a kind
Quit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started