CS10-8L: Computer Programming Laboratory Machine Problem #9: Conditional Statements
CS10-8L: Computer Programming Laboratory Machine Problem #9: Conditional Statements
Name: Score:
Section: Date:
OBJECTIVES
● To familiarize the students with the MATLAB interface.
● To enable the students to use some basic operations.
Instructions:
1. Save your file as Surname_Firstname_MP9. Ex. Santos_Jared_MP6
2. You will submit a zip file containing the following and send it to BB.
a. PDF file of Machine Problem 8 provided with the screenshot of your answers.
b. MATLAB function script with .m extension.
MACHINE PROBLEM
1. Consider an arithmetic expression of the form a # b = c. Check whether it is possible to replace with one of the
four signs: +, -, * or / to obtain a correct expression.
Enter value of a: 2
Enter value of b: 3
Enter value of c: 5
Output: True
Enter value of a: 8
Enter value of b: 3
Enter value of c: 2
Output: False
Note: Output is false because 8 and 3 will not result to 2 using +, -, *, and /.
Test
a b c Expected Output
Sample
1 2 3 5 True
2 8 2 4 True
3 8 3 2 False
4 6 3 3 True
5 5 2 0 False
6 10 2 2 False