CSC430 Lab Assignment
CSC430 Lab Assignment
LAB ASSIGNMENT 1
CODE : CSC430
GROUP : EMD2M1C
DATE : 26 May 2023
LECTURER : Mdm Syeilla Eween
Task 1
Task 2
Task 4
PSEUDOCODE
TASK 1
BEGIN
1. Display "Hello, welcome to C++ programming!"
2. Display "Press any key to exit!"
3. SYSTEM CALL "pause"
END
TASK 2
BEGIN
1. Read no1, no2
2. Calculate the sum of the numbers using the formula. sum
= no1 + no2
3. Display sum
4. Display "Press any key to exit!"
END
TASK 3
BEGIN
1. Read no1, no2
2. If no1 bigger than no2
3. max = no1
4. else
5. max = no2
6. end if
7. Display max
8. Display "Press any key to exit!"
END
TASK 4
BEGIN
1. Set cnt to 0
2. Read no
3. If cnt is smaller than no
4. Display “Hello\n”
5. else
6. Display "Press any key to exit!"
END
FLOWCHART
Task 1
BEGIN
Pause
END
Task 2
BEGIN
Calculate the sum of the numbers using the formula sum = no1 + no2
Display sum
END
Task 3
BEGIN
False
True
END
Task 4
BEGIN
Set cnt = 0
Read no
True
cnt < no
False
Display “Hello”
Display “Press any
key to exit!”
cnt = cnt + 1
END
Lab 2
1)
2)
3)
4)
Lab 3
Task 1
Trace the output of the following statement.
Task 2
Given the declaration below, find the results of each expression.
b) b = x*y+m/n*2
c) i = int (x+0.5)
d) j = x*m-n%m
e) k = m/-n
Task 4
Write a C++ assignment statement for each of the following mathematics expressions.
a)
b)
c)
d)
e)
f)
g)
LAB 4
Selection Structure
a)
b)
c)
d)
Group Discussion