Question: ***write in C follow requirements** You are given a summarized data for Arabica coffee beans, across many countries and professionally rated on a 0100 scale




You are given a summarized data for Arabica coffee beans, across many countries and professionally rated on a 0100 scale in 2016. Write. a C program to sort the coffee by total score, in descending order. The input file is a CSV file with the following fields and format for each state: country (string), region (string), owner (string), variety (string), total score (double), with cach coffee on a separate line, for example, Brazil, south of minas, lpancma coftees, Bourbon, 83.92 Total score is the sum of the score of aroma, flavor, aftertaste, acidity, body, sweetness, uniformity, balance, and moisture. Write the results in the output file, with the same tormat as the input file. The coffees are sorted by total score, in descending order, Each colfee is on a separate line, for example. Guatemala, nuevo oriente, juan luls alvarado romero, Bourbon 85,92 - Two input files are provided: coffee 2016.65y and coffee 2017.c5y - The output file should be the same name as the input file name with added prefix of sorted_. For example, if the original file name is coffee.csv, the output file name is then sorted_coffee.csv. - Assume that there are no more than 100 coffees in the file. Assume that the country, region, owner, and variety are no more than 150 characters. - Your program needs to keep track of the number of coffees in the file as it reads from it. - Use fscanf and fprintf to read and write data. To read all fields of a coffee, use the following conversion specifier for fscanf: - The program should be built around an array of coffee structures, with each coffee containing country, region, owner, variety, and total score. - Your program should include a function with the prototype below that sorts the coffees by total score, using the recursive selection sort algorithm we learnt in week 4. The selection sort \& program that sorts an integer array is attached. Please note that when the scores of coffees are the same, the order might differ from the expected order on Gradescope and the test script. void selection__sort_coffee(struct coffee list]. int n); - Qsort library function or any sorting algorithms other than recursive selection sort are not allowed. - Output file should be in the same format as the input file, with the fields separated by comma and each coffee on a separate line, and 2 decimal digits for the total score. - Follow the format of the examples below. Example (your program must follow this format precisely) coffee_2016.csv / Downlo coffee_2017.c5v selection_sort.c Aspuirements You are given a summarized data for Arabica coffee beans, across many countries and professionally rated on a 0100 scale in 2016. Write. a C program to sort the coffee by total score, in descending order. The input file is a CSV file with the following fields and format for each state: country (string), region (string), owner (string), variety (string), total score (double), with cach coffee on a separate line, for example, Brazil, south of minas, lpancma coftees, Bourbon, 83.92 Total score is the sum of the score of aroma, flavor, aftertaste, acidity, body, sweetness, uniformity, balance, and moisture. Write the results in the output file, with the same tormat as the input file. The coffees are sorted by total score, in descending order, Each colfee is on a separate line, for example. Guatemala, nuevo oriente, juan luls alvarado romero, Bourbon 85,92 - Two input files are provided: coffee 2016.65y and coffee 2017.c5y - The output file should be the same name as the input file name with added prefix of sorted_. For example, if the original file name is coffee.csv, the output file name is then sorted_coffee.csv. - Assume that there are no more than 100 coffees in the file. Assume that the country, region, owner, and variety are no more than 150 characters. - Your program needs to keep track of the number of coffees in the file as it reads from it. - Use fscanf and fprintf to read and write data. To read all fields of a coffee, use the following conversion specifier for fscanf: - The program should be built around an array of coffee structures, with each coffee containing country, region, owner, variety, and total score. - Your program should include a function with the prototype below that sorts the coffees by total score, using the recursive selection sort algorithm we learnt in week 4. The selection sort \& program that sorts an integer array is attached. Please note that when the scores of coffees are the same, the order might differ from the expected order on Gradescope and the test script. void selection__sort_coffee(struct coffee list]. int n); - Qsort library function or any sorting algorithms other than recursive selection sort are not allowed. - Output file should be in the same format as the input file, with the fields separated by comma and each coffee on a separate line, and 2 decimal digits for the total score. - Follow the format of the examples below. Example (your program must follow this format precisely) coffee_2016.csv / Downlo coffee_2017.c5v selection_sort.c Aspuirements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
