Professional Documents
Culture Documents
Lab Assesment 1-Hafiz Zkri Bin Norizan-191492857-Ry88-2021
Lab Assesment 1-Hafiz Zkri Bin Norizan-191492857-Ry88-2021
EMT30105
INDUSTRIAL MACHINERY CONTROL SYSTEM DESIGN
LAB ASSESSMENT 1
Answer
a) The variable digit
1. idigit
2. ivalue
b) Pseudo Code
Start
Switch number
break
yes statement
Case number 0 Statement
idigit=0 ivalue=3
false
break
yes statement
Case number 1 Statement
idigit=1 ivalue=4
false
break
yes
Case number 2 Statement statement
idigit=2 ivalue=6
false
break
yes
statement
Case number 3 Statement
idigit=3 ivalue=9
false
Default action(s)
“Sila Cuba Sekali Lagi”
End
1. If insert different / wrong idigit, the display will show default “Harap Maaf, Sila Cuba
Sekali Lagi”.
TASK 2
Write a program that determines Ali’s total mark according to the percentage of coursework
below. Provide the flowchart and write down your program.
a) The variable
1. T1 (Test 1)
2. T2 (Test 2)
3. LA (Lab Assessment)
4. Proj (Project)
b) Pseudo Code
c) C Program Run
Start
T1 = 30% (0.15)
T2 = 25% (0.25)
LA = 30% (0.3)
Project = 30% (0.3)
Print Total
End
a) Pseudo Code
1. If insert odd number like number 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 and etc odd number.
2. Run the number from step 1, the display will identify odd number.
1. If insert odd number like number 2, 6, 8, 12, 14, 18, 20 and etc even number.
2. Run the number from step 1, the display will identify even number.