Write a matlab function called eligible that helps the admission officer of the
ID: 3834181 • Letter: W
Question
Write a matlab function called eligible that helps the admission officer of the Graduate School of Vanderbilt University decide whether the applicant is eligible for admission based on GRE scores. The function takes two positive scalars called v and q as input. They represent the percentiles of the verbal and quantitative portions of the GRE respectively. You do not need to check the input. The applicant is eligible if the average percentile is at least 92% and both of the individual percentiles are over 88%. The function returns the logical true or false.
Explanation / Answer
%matlab code
function [isEligible] = eligible(v, q)
if (mean([v, q]) >= 92 && v > 88 && q > 88)
isEligible = true;
else
isEligible = false;
end
end
% test the function
isEligible = eligible(92,93)
%output: isEligible = 1
isEligible = eligible(87,93)
%output: isEligible = 0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.