1. Other
  2. Other
  3. computeaveragemark my solutions in any paricular class in a school...

Question: computeaveragemark my solutions in any paricular class in a school...

Question details

computeAverageMark My Solutions In any paricular class in a school, students take multiple subjects. The number of students passing a subject will depend on the threshold passing mark for the particular subject, whose value is dependent on the respective subject. A student is considered pass if their mark is equal to or greater than the passing threshold. The class teacher would like to find the average pass mark of the class, given by,sum of marks for students who passed/number of students who passed and the fraction of students who passed, given by, number of students who passed/ total students in the class Write a function computeAverageMark with the following signature function [average_mark, frac_passed]-computeAverageMark(m, pass_threshold) nputs m a vector that contains the marks of students in a class passthreshold threshold passing marlk Output: average_mark average mark of all the students who passed, given by, sum of marks for students who passed/number of students who passed frac_passed - fraction of students who passed, given by, number of students who passed/ total students in the class If the number of students who passed is zero 0, then the function must return 0 for both the average mark and the fraction of students who passed Note: You are expected to use an appropriate loop to iterate through the vector and compute the required values, rather than using MATLAB built-in functions such as sum, average and vector computations. You may assume marks will always be an integer between O and 100, inclusivecomputeAverageMark My Solutions In any paricular class in a school, students take multiple subjects. The number of students passing a subject will depend on the threshold passing mark for the particular subject, whose value is dependent on the respective subject. A student is considered pass if their mark is equal to or greater than the passing threshold. The class teacher would like to find the average pass mark of the class, given by,sum of marks for students who passed/number of students who passed and the fraction of students who passed, given by, number of students who passed/ total students in the class Write a function computeAverageMark with the following signature function [average_mark, frac_passed]-computeAverageMark(m, pass_threshold) nputs m a vector that contains the marks of students in a class passthreshold threshold passing marlk Output: average_mark average mark of all the students who passed, given by, sum of marks for students who passed/number of students who passed frac_passed - fraction of students who passed, given by, number of students who passed/ total students in the class If the number of students who passed is zero 0, then the function must return 0 for both the average mark and the fraction of students who passed Note: You are expected to use an appropriate loop to iterate through the vector and compute the required values, rather than using MATLAB built-in functions such as sum, average and vector computations. You may assume marks will always be an integer between O and 100, inclusive

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution