EXAMSHARE

Western Delta University, Oghara Delta State

department of computer science
college of computing
western delta university

first semester examination 2023/2023 session

CSC209 - foundations of sequential programming time: 2hrs: 30mins

Answer question one (1) and any other three (3) questions


  1. Question 1 (Compulsory) (25 Marks)

    1. What is program design? (2 marks)
    2. Define the following Program design tools:
      1. Algorithm
      2. Flowchart
      3. Decision Table
      4. Pseudo-Code
      (4 marks)
    3. List six (6) logical operators used in pseudocodes. (3 marks)
    4. Write explanatory notes on the following control structures:
      1. Sequence
      2. Selection
      3. Iteration
      (6 marks)
    5. Write a pseudo-code that computes and displays the product, sum, and average of three (3) integer numbers on the screen. (5 marks)
    6. Draw the corresponding flowchart. (5 marks)
  2. Question 2 (15 Marks)

    1. What are the compilers and interpreters? (3 marks)
    2. Briefly explain four (4) reasons why computer programs are designed. (4 marks)
    3. Using an appropriate diagram, discuss the program development life cycle. (8 marks)
  3. Question 3 (15 Marks)

      1. Convert 47510 to Base 2.
      2. Convert 2210 to Base 8.
      3. Convert 2210 to Base 16.
      4. Convert 110012 to Base 10.
      (8 marks)
    1. Expose the differences between Machine Language and Low-level Language. (2 marks)
      1. List three (3) advantages of machine language. (3 marks)
      2. Identify four (4) disadvantages of machine language. (2 marks)
  4. Question 4 (15 Marks)

    1. Explain the following data storage representations:
      1. Binary Coded Decimal (BCD)
      2. Unsigned representation
      3. Signed representation
      (5 marks)
      1. Store 200 and 260 in a 16-bit memory locating using unsigned representation. (4 marks)
      2. Store 30 and -40 in an 8-bit memory locating using signed representation. (4 marks)
    2. Store -40 in an 8-bit memory location using two's complement. (2 marks)
  5. Question 5 (15 marks)

    1. Compute the following:
      1. NOT 101101010111
      2. 101001011 OR 010110100
      3. 10000 AND 01011
      4. 101110111011 XOR 001111011101
      5. (6 marks)
    2. Explain the following shift operations:
      1. Logical shift left
      2. Logical shift right
      3. Circular left shift
      4. Circular right shift
      5. (6 marks)
      1. Perform shift left operation on 1000110 (2 marks)
      2. Carry out shift arithmetic right on 01100110 (1 marks)
  6. Question 6 (15 Marks)

    1. Using an appropriate example, one for each, discuss the following:
      1. 3-address machine
      2. 2-address machine
      (5 marks)
    2. Give two (2) advantages and two (2) disadvantages of a 2-address machine. (4 marks)
    3. What is an Addres format? State two (2) methods of Address format. (3 marks)
    4. Show to implement the high-level statement k = k - p - k * q on a 3-address machine. (3 marks)