Question: a. Add a select_knight function. . Implement a function starts with this declaration: int select_knight(const kingdom_data &kingdom) - This should be also to: . show

 a. Add a select_knight function. . Implement a function starts with

a. Add a select_knight function. . Implement a function starts with this declaration: int select_knight(const kingdom_data &kingdom) - This should be also to: . show the user a list of the names of the knights, and their index (from 1 to n) - ask the user to enter the index of the knight they want to select (from 1 to n) " ensure the user has entered a valid index (i.e. an integer from 1 to n) - return the index of a knight in the array (i.e. return ) This select_knight function is a useful platform to select an individual knight from your data array within the kingdom. You will then be able to pass a knight into the relevant functions/procedures where the actual work is performed. Call select_knight function: It can be called in your program for returning the selected knight index. Below is an example of its usage - how it is called and the use of the returned value. You may have alternative implementation to fulfill the same functional goal. int i; i = select knight (my_kingdom) ; //assume we have a variable "my_kingdom" if (i > 0 ) write_knight (my_kingdom . knights [i]) ; b. Create a new update_kingdom procedure which shows a menu to allow the user to choose between the different system actions: add a knight, query a knight, update a knight, delete a knight, and displaying kingdom details - Adding a knight of the kingdom will use add_knight - query_knight is a new procedure that will get the user to select a knight, and then write that knight's details to the Terminal . Deleting will need to be a new procedure - it can call select_knight to ask the user which knight to be deleted. Then use this selection in a call to delete_knight - Displaying will show the kingdom data - i.e. the name and information of all stored knights c. Build capability for add tool and delete tool in a knight's record. Note: For this step you will need to add a number of additional functions and procedures that are not explicitly listed here. Think about how you can best implement these features/function goals, and add appropriate functions and procedures, and their calls to help with this. - Add a dynamic array of strings called tools to the knight. (You may give the array a different name. Remember to align with the discussed coding convention) - Change update_knight to include the ability to add a tool, and delete a tool

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!