department of computer science
college of computing
western delta university
first semester examination 2022/2023 session
CSC209 - foundations of sequential programming time: 2hrs: 30mins
answer four (4) questions
Question 1
- Define Computer Programming (1.5 marks)
- Differentiate between interpreters and compilers (2 marks)
- What is program design? List and explain five (5) aims of program design (6 marks)
- With the aid of a suitable diagram, discuss the program development life cycle (8 marks)
Question 2
- Using a sample pseudo-code in each case describe the following control structures:
- Sequence (2.5 marks)
- Selection (2.5 marks)
- Repetition (2.5 marks)
- Write a pseudo-code that computes and displays the product, sum, average of three (3) integer numbers on the screen (5 marks)
- Draw the corresponding flowchart (5 marks)
- Using a sample pseudo-code in each case describe the following control structures:
Question 3
- Define the following Assembly language terms:
- Mnemonics
- Labels
- Operands
- Consider the Assembly language code below and use it to answer the question that follows:
READ X
Explain the code, one line after the other (3 marks)
ADD Y
STORE Z
PRINT Z
HALT - Write explanatory notes on the following:
- High level languages
- Fifth generation languages
- Convert 10010 to Base 8 (2 marks)
- Convert 75110 to Base 16 (2 marks)
- Convert 2210 to Base 2 (2 marks)
- Define the following Assembly language terms:
Question 4
- Explain the following data storage representations:
- Binary Coded Decimal
- Unsigned representation
- Signed representation
- Store 200 and 260 in a 16-bit memory location using unsigned representation (4 marks)
- Store 30 and -40 in an 8-bit memory location using signed representation(4 marks)
- Give the BCD equivalent of 1827 and 124 (3.5 marks)
- Explain the following data storage representations:
Question 5
- Compute the following:
- NOT 101101010111
- 101001011 OR 010110100
- 10000 AND 01011
- 101110111011 XOR 001111011101
- Explain the following shift operations:
- logical shift left
- logical shift right
- circular left shift
- circular right shift
- Perform shift left operation on 1000110 (2 marks)
- Carry out shift arithmetic right on 01100110 (2 marks)
- Calculate logical shift right on 11001100 (1.5 marks)
- Compute the following:
Question 6
- Define machine architecture (2 marks)
- Draw the Von Neuman model of a conventional digital computer and briefly explain its Principle of operation (5 marks)
- Write explanatory notes on the following:
- Central Processing Unit
- Data registers
- Instruction registers
- Program counter
- Memory system
- State three (3) functions of the processor (3 marks)