Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write in Matlab program. My Solutions > compute AverageMark In any paricular class in a school, students take multiple subjects. The number of students

image text in transcribedimage text in transcribedPlease write in Matlab program.

My Solutions > compute AverageMark 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 passedumber of students who passed and the fraction of students who passed, given by, number of students who passed/ total students in the clas:s Write a function computeAverageMark with the following signature function laverage_mark, frac_passed]-computeAverageMark(m, pass_threshold) nputs: m a vector that contains the marks of students in a class pass_threshold threshold passing mark Output average_mark - average mark of all the students who passed, given by, sum of marks for students who passedumber 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 0 and 100, inclusive Code to call your function 1 m[0 33 66 80 91 45 49 77 77 82] 2 pass_threshold -50; 3 [average_mark,frac_passed]-computeAverageMark(m, pass_threshold)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

LO6 Summarize various ways to manage retention.

Answered: 1 week ago

Question

LO3 Define the difference between job satisfaction and engagement.

Answered: 1 week ago