A tele match event has been held in a primary school. Three teams are allowed to participate in this match, with each team consisting of four participants. Five (5) events were contested, namely E1, E2, E3, E4 and E5. Table 1 and Figure 1 show the scores that have been collected by each team for the five events. Write a C++ program which can assist the tele match committee to determine the winner for these events. Your program should be able to do the following tasks: a) The program will read input data: team ID, participant ID and scores for the five events namely E1, E2, E3, E4 and E5 from an input file named “input.txt” into an array marks[12][7] with int type. (***Array can be 2-dimensional or 3-dimensional). b) The program must be able to notify the user if the input file cannot be opened (failed to open) with proper prompt. The example for user notification where the file fails to open is shown in Figure 2. c) Calculate the total score for each participant. d) Calculate the total score for
A tele match event has been held in a primary school. Three teams are allowed to participate in this match, with each team consisting of four participants. Five (5) events were contested, namely E1, E2, E3, E4 and E5. Table 1 and Figure 1 show the scores that have been collected by each team for the five events. Write a C++ program which can assist the tele match committee to determine the winner for these events. Your program should be able to do the following tasks:
a) The program will read input data: team ID, participant ID and scores for the five events namely E1, E2, E3, E4 and E5 from an input file named “input.txt” into an array marks[12][7] with int type. (***Array can be 2-dimensional or 3-dimensional).
b) The program must be able to notify the user if the input file cannot be opened (failed to open) with proper prompt. The example for user notification where the file fails to open is shown in Figure 2.
c) Calculate the total score for each participant.
d) Calculate the total score for each team.
Step by step
Solved in 6 steps with 1 images