0% found this document useful (0 votes)
16 views3 pages

Essential Programming Concepts Explained

The document outlines various concepts related to programming, including definitions of key terms, types of programming languages, and programming structures. It covers low-level and high-level languages, advantages and disadvantages of different programming paradigms, and the program development cycle. Additionally, it discusses program documentation, error types, and control structures, providing a comprehensive overview of programming fundamentals.

Uploaded by

nicholuskimutai3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Essential Programming Concepts Explained

The document outlines various concepts related to programming, including definitions of key terms, types of programming languages, and programming structures. It covers low-level and high-level languages, advantages and disadvantages of different programming paradigms, and the program development cycle. Additionally, it discusses program documentation, error types, and control structures, providing a comprehensive overview of programming fundamentals.

Uploaded by

nicholuskimutai3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PROGRAMMING

SECTION A:
1. Define the following terms: (6 marks)
i) Computer Program
ii) Programming.
iii) Programming language.
iv) Program portability.
v) Algorithm
vi) Pseudocode.
2. (a) What are low-level languages? Give their features. (4 marks)
(b) State 2 advantages and disadvantages of low-level languages. (4 marks)
(c) Identify two types of Low-level languages. (2 marks)
3. Distinguish between Machine language and Assembly language. (2 marks)
4. Most computer programming is carried out using High-level languages.
(a) What are High-level languages? (2 marks)
(b) Give three features of high-level programming languages. (3 marks)
(c) Give three advantages of High-level languages as opposed to Low-level languages.
(3
marks)
5. List three considerations which are present in Assembly language programming but not in
high-level programming. (3 marks)
6. (a) Examine two features of fourth generation languages (4GLS) (2 marks)
(b) Highlight four advantages of fourth generation languages (4GLS) (4 marks)
(c) List three examples of fourth generation programming languages. (3 marks)
7. Describe the main feature of fifth generation languages. (1 mark)
8. (a) Define the term Object-Oriented programming. (2 marks)
(b) List two examples of:
(i) third generation languages (2 marks)
(ii) object oriented languages. (2 marks)
(c) Give an advantage of using an object-oriented programming language. (1 mark)
9. Explain the meaning of the following as used in computer programming. (2 marks)
(i). Syntax
(ii). Semantic
10. Describe 5 factors to be considered while choosing a programming language. (5 marks)
11. Differentiate between the following as used in programming:
(a) Source program and object code. (1 mark)
(b) Flowchart and Pseudocode. (2 marks)
12. What does the following abbreviations stand for: (2 marks)
i) FORTRAN
ii) COBOL
iii) OOP

13. (a) Define a Language translator. (1 mark)


(b) What is the purpose of the following translator programs?
i) Assembler. (1 mark)
ii) Compiler. (1 mark)
iii) Interpreter. (1 mark)
(c) For each of the following programming languages, give their respective translators.
(2
marks)
14. Give two advantages of compiling a program rather than interpreting it. (2 marks)
15. Outline the seven stages in program development cycle in their logical sequence. (7 marks)
16. In program development cycle, what takes place in:
(a) Problem definition. (1 mark)
(b) Program documentation. (1 mark)
17. Give two reasons why it is necessary to have a program design. (2 marks)
18. Using illustrations, explain at least six symbols used in flowchart design. (6 marks)
19. (a) Identify and briefly describe two types of flowcharts. (4 marks)
(b) State any four rules you would follow when: (8 marks)
i) Writing a pseudocode.
ii) Drawing a flowchart
(c). Give two advantages of pseudocodes over flowcharts. (2 marks)
20. Define the following types of computer program errors:
(a) Syntax error. (2 marks)
(b) Logical error. (2 marks)
(c) Run-time (Execution) error. (2 marks)
(d) Semantic error. (2 marks)
21. What do you understand by the following terms:
(a) Dry running. (1 mark)
(b) Structured walkthrough. (1 mark)
(c) Test data. (1 mark)
(d) User Defined Function/ Procedure (UDF) (1 mark)
22. (a) What is Program Documentation? (2 marks)
(b) In what stage of the development does program documentation take pace? (1 mark)
(c) State two reasons for documenting all the stages of program development. (2 marks)
(d) Describe three types of program documentation in reference to programming. (6 marks)
23. Briefly explain the purpose of the following types of program documents. (3 marks)
(i). User manual/guide
(ii). Reference guide
(iii). Quick reference guide.
24. (a) Explain the meaning of Program control structures. (2 marks)
(b) State the three basic types of program control structures. (3 marks)
(c) Draw simple flowcharts to illustrate the following program control structure:
i). The Nested IF selection
ii). The FOR loop
iii). REPEAT…UNTIL loop. (3 marks)

25. Name the control structure depicted by the flowchart below. (1 mark)

26. Highlight two disadvantages of monolithic programs. (2 marks)


27. (a) Define the term Structured programming. (2 marks)
(b) List any two characteristics of Structured programming. (2 marks)
(c) Give two benefits of Structured programming. (2 marks)
28. Structured programming language and Object-oriented programming language are the two
main forms of high-level languages. State the difference between the two? (4 marks)
29. (a) Define the term Selection in relation to program control structures. (1 mark)
(b). List four selection control structures used in writing a program. (4 marks)
State four features of a user-friendly program.

Common questions

Powered by AI

Syntax refers to the structure and form of code that a compiler or interpreter can understand, ensuring that the code adheres to predefined rules . Semantics, on the other hand, pertain to the meaning of code; even if code is syntactically correct, it can be semantically incorrect if it doesn't produce the intended result . Different error types, such as syntax errors, semantics errors, logical errors, and runtime errors, shape language design by forcing the creation of robust error-checking mechanisms and constructs that facilitate debugging and maintenance . This contributes to a programming language’s user experience and developer productivity .

Object-oriented programming languages are beneficial over structured programming languages due to their modular structure, which allows for the encapsulation of data and functions into objects . This facilitates reuse and scalability, as objects can be easily modified and extended without affecting other parts of the program . They also support inheritance, which enables new objects to take on properties of existing ones, minimizing redundancy and enhancing maintainability . In contrast, structured programming languages focus more on procedure and function structures without the encapsulation provided by objects .

Program portability refers to the ability of software to be run on multiple hardware platforms with minimal modification . This is important as it reduces development costs and time because it eliminates the need to rewrite codes for new platforms, thereby ensuring wider distribution and accessibility of the program . Portability also aids users by providing consistent functionality across different devices .

Low-level programming languages, including Machine language and Assembly language, are closer to machine code and hardware, which makes them fast and efficient but difficult to write and understand for humans . They require understanding of the architecture of the system they run on . Conversely, high-level languages are more abstract, easier to write, understand, and they are platform-independent, meaning they emphasize portability . High-level languages often include features like rich libraries and automatic memory management, which low-level languages lack .

Translators are crucial in converting higher-level programming languages into machine code that can be executed by a computer's processor . There are three main types of translators: assemblers, compilers, and interpreters. Assemblers translate assembly language into machine code . Compilers convert entire high-level language programs into machine code before execution, optimizing performance . Interpreters translate and execute high-level language code line-by-line, which is useful for scripting and immediate debugging . The choice of translator depends on the programming language and the nature of the application being developed .

Fourth generation languages (4GLs) are distinguished by their emphasis on reducing the complexity of programming and increasing programmer productivity . They are often non-procedural and allow users to specify what they want done without detailing how to do it. This makes them easier to learn and use than lower-level languages . Additionally, 4GLs are often designed for specific domains, facilitating rapid application development with more visual tools and higher abstraction levels .

When selecting a programming language for a new software project, one should consider factors such as: 1) Language performance in terms of speed and resource efficiency; 2) Portability across different systems and platforms; 3) The availability of libraries and frameworks that facilitate development; 4) Community support and documentation, which are crucial for troubleshooting and learning; 5) Compatibility with existing systems and tools . These considerations ensure that the language will meet both technical and project-specific needs .

The stages in the program development cycle, in logical sequence, are: 1) Problem definition, where the requirements and objectives of the program are analyzed; 2) Program Design, involving the choice of a suitable algorithm and programming language; 3) Coding, where the actual code is written; 4) Testing, including debugging and verifying the program; 5) Documentation, providing details of the design and coding process; 6) Implementation, where the program is put into operation; 7) Maintenance, involving updating and fixing any issues found after deployment .

Structured programming enhances code clarity and maintenance by breaking down complex programs into manageable modules or functions, each with a single task or responsibility . This modularity supports the logical structure and reusability of code, making it easier to update and debug. Unlike monolithic programming approaches, where programs are developed in large, continuous blocks of code, structured programming increases readability and reduces redundancy, which in turn facilitates collaboration among developers and simplifies long-term maintenance .

Flowcharts provide a visual representation of the sequence and flow of processes, making them useful for outlining complex procedures and understanding the structure of algorithms . They are particularly helpful in the early stages of design to map out logic and step sequences . Pseudocode, on the other hand, breaks down the algorithm into natural language-like steps, bridging the gap between flowcharts and actual coding . It is often more advantageous because it closely resembles coding structures, aiding in the smooth transition from design to implementation with less ambiguity .

You might also like