[2019] ENG 1002 Programming (Matlab and C) - Semester 1 - Primary Examination - Q3 Selection
This question has been solved
Question 3
Selection
CourseNana.COM
(a) Write a MATLAB if-statement that captures the following logic:
Given a variable called waterTemp, display ’gas’, ’liquid’ or ’solid’ indicating the current state of the water based on the value of waterTemp. Water becomes a gas at 100C and a solid at 0C. [3 marks]
CourseNana.COM
(b) Use && ∥ and ∼ operators to write an if-condition that is true if a given number, n, is an even number that is less than 1 or greater than 100 (inclusive) [3 marks]
CourseNana.COM
(c) Write a MATLAB switch-statement that is equivalent to the following if- statement:
CourseNana.COM
if number == 1 || number == 100
CourseNana.COM
disp("Extreme value");
CourseNana.COM
elseif number == 50
CourseNana.COM
disp("Mean value");
CourseNana.COM
else
CourseNana.COM
disp("Invalid number");
CourseNana.COM
end
CourseNana.COM
The University of Adelaide代写,ENG 1002代写,Programming (Matlab and C)代写,C代写,Matlab代写,The University of Adelaide代编,ENG 1002代编,Programming (Matlab and C)代编,C代编,Matlab代编,The University of Adelaide代考,ENG 1002代考,Programming (Matlab and C)代考,C代考,Matlab代考,The University of Adelaidehelp,ENG 1002help,Programming (Matlab and C)help,Chelp,Matlabhelp,The University of Adelaide作业代写,ENG 1002作业代写,Programming (Matlab and C)作业代写,C作业代写,Matlab作业代写,The University of Adelaide编程代写,ENG 1002编程代写,Programming (Matlab and C)编程代写,C编程代写,Matlab编程代写,The University of Adelaideprogramming help,ENG 1002programming help,Programming (Matlab and C)programming help,Cprogramming help,Matlabprogramming help,The University of Adelaideassignment help,ENG 1002assignment help,Programming (Matlab and C)assignment help,Cassignment help,Matlabassignment help,The University of Adelaidesolution,ENG 1002solution,Programming (Matlab and C)solution,Csolution,Matlabsolution,