Part 3: Large Coding Question[P3 Q1] Quack from afar[P3Q2] Quack Family - Siblings[P3 Q3] Chucky's Chicken App1) Read in Menu From File2) Order Items3) Calculate Prices4) Charge the UserScaffold[P3 Q1] Quack from afarThe ProblemUnfortunately, the duck population has seen an outbreak of QUACK19, and the Duck governmenthas placed social distancing restrictions on all pond activities. However, the Duck government isconstantly changing their distancing requirements, so it is up to you to determine which ducks areallowed to swim in the pond.You are provided with a file which contains a list of coordinates of where ducks will land in apond. Ducks will land in the pond one after the other. The order that coordinates appear in thefile corresponds to the order they will land in the pond.When a duck attempts to land in the pond, it must first determine if the position it wants to landis far enough away from any of the current ducks in the pond. Using the distance that the DuckGovernment has given you, we can calculate whether the new duck will encroach on existingducks in the pond. If their landing spot is too close to other ducks, they will keep flying and findanother pond somewhere (we do not care about the other pond).After all the ducks in violation of social distancing have moved on, you should write to a file thecoordinates of all the ducks which are currently in the pond. The order these ducks appear in thefile should preserve the order in which they arrived in the pond.Your program should the write to a file with the same name as the filename parameter,although prefixed with filtered- .For example, if my filename is ducks.txt , I would write the filtered duck coordinates tofiltered-ducks.txt . Another example, if my filename was pond.ducks , I would write thefiltered duck coordinates to filtered-pond.ducks .The TaskWrite a function distance_ducks(filename, distance) . The function will read a file from thegiven filename which contains the coordinates of duck landing zones in a pond. Thefunction will then filter the file so that only ducks adhering to social distancing rules can stay inthe pond. The function will then write to a file containing the coordinates of ducks which are notin violation of social distancing.If the file cannot be opened because it does not exist, you must catch the FileNotFoundErrorobject and throw a new exception FileNotFoundError with the contents of the exception beingthe filename. Any other exception for failure to open a file is not caught.If the parameter filename is not a string type, then a TypeError exception is thrown with thecontents of the exception being a string "parameter filename is not a string" .If the parameter distance is not a float or int type, then a TypeError exception is thrown withthe contents of the exception being a string "parameter distance is not a numeric type" .The fileEach line in the file will consist of two floating point values separated by a comma. Each new lineof the file represents the position that a new duck will attempt to land in the pond.An example of the file contents is shown below:You can find sample input and output files in the testing folder in your workspace.The directory names in outputs specify the distance value used, e.g. 1-5 indicates 1.5m ofdistance between ducks.Note:You do not have to write your own tests / test driver for this task (although you can if you'd like).The contents of the testing directory are sample outputs for you to check if your program isworking. This is optional.The directory structure for the testing folder is to let you know the distance value that was usedwhen the sample outputs were generated, so that you can test your function with the samearguments (to hopefully get the same output). Check the README file, You can use the diffcommand to check if your output file matches the sample.Your program does not have to mimic this directory structure. You can assume that python willoutput the file in the same directory as the input file (I recommend you put your input files in thecurrent working directory).Disclaimer: you are not guaranteed to be provided sample tests in the examCalculating DistanceYou can use Euclidean distance to calculate the distance between any two ducks:Consider two ducks and with associated coordinates and .1.45,10.5-3.51,0.3151.925,-9.338-9.283,3.190-0.261,-10.5283.877,-13.0030.740,-12.0949.066,10.7071.099,11.568-5.154,-6.7301.134,-5.480-13.035,-0.588The distance between the ducks can be found with the following formula:Due to floating points having some precision issues, you are allowed to correct for errors lessthan 0.0001.That means, 1.500000005135 would be considered as 1.5 in regards to the distance calculation.[P3Q2] Quack Family - SiblingsThe ProblemA duck can usually raise 12 ducklings, which is quite a lot. In the Kingdom of Mallard, there is aculture of recording their own family tree. Some family trees can trace back hundreds of years oflineage, while others have records of only the latest generation.You have found some family trees online. While you were learning about their history, you had anidea to present the family tree interactively. Specifically, you would like to interactively count andidentify the siblings and step-siblings of a given duck of interest.The provided data files present the details of each duck in a separate row in the following format:<name>, <gender>, <year of birth>, <father>, <mother>Each data field is separated by commas. An example of the file contents is shown below:The TaskWrite a function count_siblings(filename, name) . The function will read a file from the givenfilename which contains the family tree of the duck of interest. It will then determine the siblings(same father and mother) and step-siblings (same father, different mother or same mother,different father) of the duck. The function will return a string in the following format:<name> has <number> siblings: <list of siblings>, <list of step-siblings>Siblings will be listed first, followed by step-siblings. Step-siblings will also be identified with thestring (step) following their names. Regular English punctuation will need to be applied. Forexample, from the data of the sample file shown above:If the parameter filename is not a string type, then a TypeError exception is thrown with thecontents of the exception being a string "parameter filename is not a string" .If the parameter name is not a string type, then a TypeError exception is thrown with thecontents of the exception being a string "parameter name is not a string" .Theo, m, 1958, ,Ray, m, 1952, ,Stephen, m, 1979, Theo, MaryDaffy, m, 1976, Ray, MaryAnnabelle, F, 1975, John, OliviaRyan, m, 1981, Ray, PenelopeChris, m, 1981, Theo, MaryDeborah, F, 1996, Stephen, AnnabelleDominic, m, 1997, Ryan, MayBrian, M, 2007, Ray, PenelopeMelvin, m, 1981, Ray, Penelopeprint(count_siblings("family.dcf", "Brian"))
...