The following table lists the sizes of mens shirts that fit for different measur
ID: 3661713 • Letter: T
Question
The following table lists the sizes of mens shirts that fit for different measurements of the chest and waist. Create a function names computeshirtsize that returns the size as a string (written exactly as in the table above) such the given chest and waist measurement are both within the given ranges. Note that the measurement ranges overlap; if the given chest and waist measurements fit more than one shirt size, the function must return the smallest size that fits, If the given chest and waist measurements do not fit any of the given shirt sizes. Not available must be returned.Explanation / Answer
function shirtsize=computeShirtSize(chest,waist)
a=chest;
b=waist;
%check the boolean condition
if((a>=38 |a<=42)&&(b>=30|b<=35))
fprintf('Shirt size is Small' );
elseif((a>=40|a<=44)&&(b>=32|b<=37))
fprintf('Shirt size is Medium' );
elseif((a>=42|a<=46)&&(b>=34|b<=39))
fprintf('Shirt size is Large' );
elseif((a>=44|a<=48)&&(b>=36|b<=41))
fprintf('Shirt size is X-Large' );
elseif((a>=46|a<=50)&&(b>=38|b<=43))
fprintf('Shirt size is XX-Large' );
else
fprintf('Shirt size is Not Available' );
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.