Question: In this program, you will work with a structure representing a LEGO building set, which is defined as follows ( from LegoSet.h ) : largest:
In this program, you will work with a structure representing a LEGO building set, which is defined as follows from LegoSet.h:
largest: Find and print the set with the most pieces in an array of LegoSet structures using the largestSet function described below:
unsigned largestSetLegoSet list unsigned n: takes in an array of LegoSet structures, list, and the number of structures in the array, n Function returns the index of the structure with the most pieces.
You must complete the main function in examstructmain.c as well as the three function definitions in LegoSet.c
Your final program should recognize three commands:
age: Prompt the user to enter an age and print all sets that are appropriate for someone of that age in other words, the age input is between the minimum and maximum age for that set, including those endpoints using the findByAge function described below:
void findByAgeLegoSet list unsigned n unsigned a: takes in an array of LegoSet structures, list, the number of structures in the array, n and the desired age, a Function prints all ageappropriate sets found in list, as well as the total number of sets that were printed. For example, if I enter age the output would be:
exit: Exit the program
In addition, you must write one more function:
void printSetLegoSet ls: Given a pointer to a LegoSet structure, print the contents of that structure to match one of the two formats below. If the maximum age in the structure is the output should match this form, showing only the minimum age:
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
