Question: 1. Below shows three different test marks for the students in a tuition centre. Student Name English Malay Maths Ali 68 89 76 Bobby 87

 1. Below shows three different test marks for the students in

1. Below shows three different test marks for the students in a tuition centre. Student Name English Malay Maths Ali 68 89 76 Bobby 87 73 79 Chong 59 55 90 David 85 70 68 Elisa 88 83 90 (a) Declare a two-dimensional array named testMarks and initialize it with the marks above. Please note that each row of the array is correspondent to one student's results. (b) Create a one-dimensional array named studNames and initialize it with the student names as shown above. Similarly create another array named tests and initialize with the test names (English, Malay and Maths). (c) Create a function named search_stud_index, which will accept a student name. If the student name is found in the studNames array, then returns the index of the item in the array, else returns -1. (d) Create a function named get_highest_mark that will accept a string value. This function will call the search_test_index to obtain the correspondent tests index based on the given string. If the index is not -1, then based on the index, it will search and display the correspondent student name (from the studNames array) with the highest mark of the given test Example of the function call: get_highest mark ("English") ; Example of output of the function : Highest Mark for English: 88 Name: Elisa If search_test_index is not successful (returns -1), then it will call the search_stud_index to obtain the correspondent studNames index. If the index is not -1, then based on the index, it will search and display the highest mark of the tests. Example of the function call: get_highest mark ("Ali") ; Example of output of the function : Highest Mark for Ali: 89 Test: Malay Display "Invalid parameter" if the parameter of the function is invalid

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 Mathematics Questions!