The following table shows the height and age of some potential basketball players a team is willing to draft. Assuming the search criteria is age less than 26 and height greater than 75 inches, identify the players who meet the criteria, and use fprintf command to return the search result to the command window in the following format:
The following candidates meet the height and age requirement:Candidate #1 is 24 years old and 79 inches tallCandidate #4 is 23 years old and 77 inches tallCandidate #8 is 20 years old and 77 inches tall.
(The table have the values for age and height presented below.)
age=[24,26,18,23,27,29,21,20,26,18,22,27];height=[79 82 72 77 78 83 73 77 76 81 79 82];for i=1:12 n(height,age)=rand() if (age<26 && height>75) disp('These are the students') elseif (age==24 && height==70) disp('Candidate1') elseif (age==23 && height==77) disp('Candidate2') else (age==20 && height==77) disp('Candidate3') end end
Best Answer