Answered step by step
Verified Expert Solution
Question
1 Approved Answer
https://doh.gov. ph/covid19tracker https://drive.google. com/drive/folders/1Z8uIWCE0-Wty5k1pYF1QKoZgf2EIOogw?usp=share_link Sample Test Results TEMPLATE CODE: HEADER file and TEMPLATE code Gdrive link for easier copy-paste for you (REMOVE SPACE IN MIDDLE
https://doh.gov. ph/covid19tracker
https://drive.google. com/drive/folders/1Z8uIWCE0-Wty5k1pYF1QKoZgf2EIOogw?usp=share_link
Sample Test Results
TEMPLATE CODE:
HEADER file and TEMPLATE code Gdrive link for easier copy-paste for you (REMOVE SPACE IN MIDDLE TOO VIEW)
https://drive.google. com/drive/folders/1Z8uIWCE0-Wty5k1pYF1QKoZgf2EIOogw?usp=share_link
But I will still show screenshots here for your reference:
HEADER FILE:
TEMPLATE CODE:
Modify the program below using the CSV Spreadsheet and TEMPLATE code \& HEADER FILE below, SO that it will replicate the COVID19 Tracker (IF you want to view COVID19 Tracker link, REMOVE SPACE in middle as chegg doesn't allow links) USE the CSV SPREADSHEET and EDIT TEMPLATE CODE \& HEADER FILE given below. Comments are already written for you for easier understanding of the functions FOR your convenience and easier coding ONLY Write or Edit the code on these comments that are written in the given template: 1. //Write your fields below 2. I/Write your code below 3.. //You can edit this 4. //Make sure to change the fields below to work with the given CSV file. 5. I*Make sure to change the code below as it doesn't work with the given CSV file. Yes, you can delete the whole function except for function definiton above* / 6. HEADER FILE edit: //You can have some prompt here to catch some erros in conversion. You are provided with the official August 4, 2020, Spreadsheet or Data Drop from DOH in CSV format. CSV file google drive folder link: (REMOVE SPACE in middle TO VIEW THE LINK) (Download and use EXCEL to USE the SPREADSHEET FILE) On the said spreadsheet, your program should have the ff analytics functionality: Total Number of Cases: (a) Confirmed, (b) Active, (c) Recovered, (d) Death Total Confirmed Cases by Region Total Confirmed Cases by Region and Published Date Total Confirmed Cases by Age Group Analysis Options: 1. Total Confirmed Case 2. Total Case By Region 3. Total Case on Region by Publish Date 4. Total Death by Age Group 5. Exit Choice: 3 Type Region: NCR Type Date[YYYY-MM-DD]: 2019-06-05 Total count on NCR published on 2019-06-05 is 0 Choice: 5 Analysis Options: 1. Total Confirmed Case 2. Total Case By Region 3. Total Case on Region by Publish Date 4. Total Death by Age Group 5. Exit Choice: 4 Enter Age Group (e.g. 50 to 54): 60 to 64 Total count for agegroup 60 to 64 is 289 Choice: 5 /*Counts Death on a specific age group * Arguments: * report = A structure array that contains the data to be analyzed * agegroup = The target age group in Five-year format (e.g. 50 - 54) * N = contains the number of records from the given report * Returns: * number of death records on a specific age group * Note: * Return Data Type is Long because confirmed cases may exceed Limit of int (which 32 767) */ long countDiedByageGroup(EpiData *report, char *agegroup, int N ) f //Write your code below return 8;//You can edit this / Compares whether two dates are equal or not * Arguments: * src_date = the original date * target_date = the target date * Returns: * true if they are the same. False if they're not * Note: * - Datetime is simply a shortcut to the built-in struct tm of C - In order to access the "fields" inside tm make sure to check struct tm documentations - It will only check year, month and day only. Does not include hour, minute, second Reference: * http://ww. cplusplus.com/reference/ctime/tm/ bool isdateEqual(Datetime src_date, Datetime target_date) \{ //write your code below return false; //you can edit this \} /** Counts the confirmed cases on a specific region name on a specific date * Arguments: report = A structure array that contains the data to be analyzed region = The name of region that to be "searched" on. date = The data to be "searched" on in string format. (format: MrY-MM-DD) N= contains the number of records from the given report * Returns: the count of confirmed cases on from the given region on a specific date * Note: * This function wiLl only work it is "exactly" the same as the region name If region name is misspelled, then this function will return a count of zero It assumes that the input date variable is in the format of MY-NM-DO. For the date, it would be based on DateRepconf column as mentioned from DOH's metadata This function uses isDateEqual function. double countRegionByPublishDate(EpiData *report, char *region, char *date, int N) \{ / write your code below \} / Counts the confirmed cases on a specific region name * Arguments: report = A structure array that contains the data to be analyzed region = The name of region that to be "searched" on. N= contains the number of records from the given report Returns: the count of confirmed cases on from the given region Note: This function wiLl only work it is "exactly" the same as the region name If region name is misspelled, then this function will return a count of zero long countregion (EpiData sreport, char *region, int N ) f //Write your code below return 8;// You can edit this } *Serves as the main "Manager" for different types of analysis Shows also the prompt to help the user which type of analysis he wants Arguments: report = A structure array that contains the data to be analyzed N= contains the number of records from the given report Returns: No return. id analyzeData(EpiData *report, long N) int choice =0; char region [256], date [256], ageGroup[256]; Case totalCount; long count =0; printf("Analysis Options: ); printf("1. Total Confirmed Case \ "); printf("2. Total Case By Region ); printf("3. Total Case on Region by Publish Date n); printf("4. Total Death by Age Group ); printf("5. Exit ); do \{ printf("Choice: "); scanf("\%d", \&choice); if ( choice ==1 ) \{ totalCount = calcCases ( report,N); \} else if ( choice ==2 ) \{ printf("Enter Region: "); scanf(" \%[^ ]s, region); count = countRegion (report, region, N ); printf("Total count on \%s is \%ld , region, count); \} else if (choice ==3 ) \{ printf("Enter Region: "); scanf(" %[ ]s, region); printf("Enter Date[YYYY-MM-DD]: "); scanf(" \%[^ ]s, date); count = countRegionByPublishDate (report, region, date, N); printf("Total count on % published on \%s is \%ld , region, date, count); \} else if (choice ==4 ) \{ printf("Enter Age Group (e.g. 50 to 54): "); scanf(" %[ ]s, ageGroup); count = countDiedByAgeGroup (report, ageGroup, N); printf("Total count for agegroup \%s is \%ld , ageGroup, count); \} \} while (choice !=5 ); int main(void) //The variable to store all data here EpiData *report; report = (EpiData *)malloc(1000000 * sizeof(EpiData)); //max of 1,000,000 records // At this point, it loads sample1.csv, but this is not the data you want for covid! // Can you check what is the filename for the data of covid cases? long total = loadCSV("sample1.csv", "assets", report); analyzeData(report, total); //Free up the memory free(report); return 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started