Answered step by step
Verified Expert Solution
Link Copied!

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 11.1 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 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

How would you establish the value of learning this material?

Answered: 1 week ago