Question: I need a help on this problem, and please follow input.txt exactly as the question . Thank You QUESTION 2 Ministry of Transport Malaysia is

I need a help on this problem, and please follow input.txt exactly as the question. Thank You

I need a help on this problem, and please follow input.txt exactlyas the question. Thank You QUESTION 2 Ministry of Transport Malaysia isrequired to prepare a report of the total road accidents by states

QUESTION 2 Ministry of Transport Malaysia is required to prepare a report of the total road accidents by states in Malaysia from the year, 2006 to 2015. INSTRUCTIONS: Write a CH program to calculate the average number of road accidents for each state and find the highest number of road accidents from 2006 to 2015. Your program should be able to do the following tasks: (a) The program should use the following struct definition: struct dataAcc { int numAcc[10]; /umber of road accidents from 2006-2015 string state; //states in Malaysia float avg; //average number of road accidents for 2006-2015 (b) The program should use an array of struct defined in (a) to store the total road accidents by states in Malaysia from 2006 to 2015. (c) The program will read input data from an input file named input 1.txt" into the array of struct declared in (b). Example of input data in "input.txt" is shown in Figure 3. (d) The program should have two (2) global constants and one (1) global variable as follows: Global contants: NUM_STATE = 14 Number of states NUM_YEAR = 10 - Number of years Global variable: out Variable to point to output file named "output.txt" (C) Besides the function main(), the program has three (3) other functions as described in Table 1. One of the functions is given below: void displayLine() ( for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!