The professors for EAS 230 teach the following lecture secti
Solution
% section takes the input and trims the leading and trailing blank spaces
section = strtrim(input (\'Enter your lab section in Capital: \',\'s\'));
% printing the lab section %s is the string variable \'section\'
fprintf(\'Your lab section is %s.\ \', upper(section));
% upper convert any input to Capital case
% section(1) refers to the first character of the input like if the input is A3 then section(1)= A and section(2)=3
switch upper(section(1))
% case have 2 condition it can take either A or B
case {\'A\', \'B\'}
fprintf(\'Your professor is Dr Alaa Hassan Ali.\ \' );
case \'C\'
fprintf(\'Your professor is Dr William Banas.\ \' );
otherwise
fprintf(\'Not a valid Lab section\ \' );
end
switch upper(section)
case {\'A3\', \'A4\', \'B4\'}
fprintf(\'Your TA is Afsoun.\ \' );
case {\'A1\', \'A2\',\'B3\'}
fprintf(\'Your TA is Mike.\ \' );
case {\'C1\',\'C2\',\'C4\'}
fprintf(\'Your TA is Ge.\ \' );
case {\'B1\',\'B2\',\'C3\'}
fprintf(\'Your TA is Roy.\ \' );
otherwise
fprintf(\'Not a valid Lab section\ \' );
end
