This document contains instructions for a computer programming lab exercise introducing C programming. It includes tasks to design pseudo-code according to rules, convert a pseudo-code program to a flow chart and vice versa, and modify a simple C program to print a welcome message and include additional functions.
1. UNIVERSITI TUN HUSSEIN ONN MALAYSIA
FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING
DTI2143/DAM31303: COMPUTER PROGRAMMING
LAB EXERCISE 2: Design Recap and Introduction to C - the program
1. What are the 6 rules to design pseudo-code?
2. Transform pseudo code below into flow chart
o Start
o Accept first integer, X
o Accept second integer value, Y
o Compute the multiplication of first integer value and second integer value: result
= X*Y
o Display result
o End
3. Convert the flow chart below to pseudo code
2. 4. Open a complier on your PC, find either Turbo C++ or Dev- C++
a. Run (execute) the following program:
#include <stdio.h>
void main ( )
{
printf(“ SELAMAT DATANG KE KELAS PENGATURCARAAN C”);
printf(“n WELCOME TO C PROGRAMMING CLASS”);
}
b. Add #include<conio.h> after include <stdio.h>, state the difference(s).
c. Add getch() before { , state the difference(s).
d. Rewrite the program to display the following