Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The professors for EAS 230 teach the following lecture sections: Dr. Alaa Hassan

ID: 2318776 • Letter: T

Question

The professors for EAS 230 teach the following lecture sections: Dr. Alaa Hassan All: Sections A and B Dr. William Banas: Section C The TAs for EAS 230 teach the following lab sections: Afsoun: A3, A4, and B4 Mike: A1, A2, and B3 Ge: C1, C2, and C4 Roy: B1, B2, and C3 Using a switch/case structure, write a MATLAB script where the user will section (from the keyboard) and the following messages will be displayed: Your professor is . Your TA is . If the lab section entered is not listed above, the script should display: Not a valid lab section!

Explanation / Answer

labsec='A1';

switch labsec

case 'A1'

fprintf('Your professor is Dr Ala Hassan All');

fprintf('Your TA is Mike');

case 'A2'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Mike');

case 'A3'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Afsoun');

case 'A4'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Afsoun');

case 'B1'

fprintf('Your professor is Dr Ala Hassan All');

fprintf('Your TA is Roy');

case 'B2'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Roy');

case 'B3'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Mike');

case 'B4'

fprintf(' Your professor is Dr Ala Hassan All');

fprintf('Your TA is Afsoun');

case 'C1'

fprintf('Your professor is Dr Willian Banas');

fprintf('Your TA is Ge');

case 'C2'

fprintf(' Your professor is Dr William Banas);

fprintf('Your TA is Ge');

case 'C3'

fprintf(' Your professor is Dr William Banas');

fprintf('Your TA is Roy');

case 'C4'

fprintf(' Your professor is Dr William Banas');

fprintf('Your TA is Ge');

otherwise

disp('Not a valid lab section!');

end