Question: bestInPlants Function Name: bestInPlants Input: ( 1 N struct ) Structure array with the description of the people who are competing ( 1 M char
bestInPlants Function Name: bestInPlants Input: N struct Structure array with the description of the people who are competing M char Name of the banned field Output: P char A sentence describing the winner and the runner up Description: Write a function that takes in a xN structure array of participants and finds the winner based on the criteria below. Each structure will have a Participants field with the name of the person, a BaseNumber field with a numerical score, a Multiplier field with a numerical value, and other fields that represents various attributes of their plants. The values of these fields will be either Y or N Delete the participants that have a value of Y for the banned field and then remove the field from the structure array. Calculate the base score of each participant by multiplying the BaseNumber entry with the Multiplier entry. Place these values into a new field in the structure array called Uniqueness. Then, delete the BaseNumber and Multiplier fields. Find if the Rare and Variegated fields exist. The participants who have Y as the value for either of those fields gain points to their uniqueness score. If they have both, add points. Sort the structure array by the Uniqueness score in descending order. Find the first place winner participant with the best score and the runner up and output the results: is the winner of the Best In Plant contest and is the second place winner!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
