Software Development  ·  Level 6
Structured Programming
Chapter 1: Apply Computer Programming basics
📚 4 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • Identify different programming language types based on what the user needs.
  • Apply programming paradigms that best fit the user's requirements.
  • Follow the program development life cycle correctly throughout a project.
  • Use program design tools that effectively meet the user's needs.

These skills will help you create well-structured programs that solve real problems and meet user expectations in the world of technology.

Programming forms the backbone of modern digital systems that drive efficiency and innovation across all professional fields in Kenya. Whether automating patient records at county referral hospitals, managing customer accounts in banks, or optimizing inventory systems in retail businesses, understanding programming languages enables professionals to create, maintain, and improve software applications. This chapter introduces the fundamental types of programming languages, providing learners with a foundation to select and apply suitable programming paradigms in diverse workplace environments.

1.1 Programming Language Types

Programming languages are tools that allow humans to communicate instructions to computers in a structured and understandable way. Different types of programming languages exist to address various problem domains and development styles. In Kenyan organizations such as universities and county government offices, choosing the right programming language type can impact project success, maintainability, and scalability.

1.1.1 Overview of Programming Language Categories

Programming languages are broadly categorized based on their design philosophies and the programming paradigms they support. These categories help developers select languages best suited for specific tasks, such as data processing, user interface design, or system control. The main categories include procedural, object-oriented, functional, and others like logical and scripting languages, though the focus here is on the first three due to their widespread use.

Procedural Languages

Procedural languages organize instructions sequentially, focusing on procedures or routines to perform tasks. This paradigm emphasizes a step-by-step approach, making it intuitive for solving problems with a clear sequence of operations.

Object-Oriented Languages

Object-oriented languages model real-world entities as objects encapsulating data and behavior. This approach improves modularity and code reuse, which is valuable in large-scale applications, such as those used by banks and insurance firms in Kenya.

Functional Languages

Functional programming treats computation as the evaluation of mathematical functions, avoiding changing states and mutable data. This paradigm enhances code predictability and is useful in scenarios requiring high reliability, such as data analysis in agricultural cooperatives.

Other Language Types

Additional categories include scripting languages, which automate tasks and glue software components, and logical languages used in artificial intelligence. However, these are less common in the foundational programming curriculum for diploma students.

1.1.2 Procedural Programming

Procedural programming is one of the earliest and most fundamental programming paradigms. It involves writing sequences of instructions that the computer executes in order, often grouped into procedures or functions. This paradigm is widely used in software development for organizations such as hospitals where clear, stepwise processes are essential.

Characteristics of Procedural Programming

Procedural programming languages feature linear control flow, use of variables, and modularity through functions or procedures. This makes the code easier to follow and debug in applications like patient management systems at county hospitals.

Advantages in Practical Use

Procedural programming simplifies program design by breaking down tasks into smaller sub-tasks. For example, a cooperative society’s accounting software may use procedures to handle member registration, loan processing, and payment schedules sequentially.

Common Procedural Languages

Languages like C, Pascal, and early versions of BASIC are procedural. Even modern languages such as Python support procedural programming styles, allowing developers in diverse sectors like retail businesses to automate inventory controls.

Limitations

Procedural programming can become unwieldy for very large or complex applications due to difficulties in managing shared data and maintaining code modularity. For instance, a county government payroll system with many interacting components may require more advanced paradigms.

Application Example

At a university’s examination office, procedural programs can automate generating student results by following a clear sequence: input data, calculate grades, and print reports, ensuring accuracy and efficiency.

1.1.3 Object-Oriented Programming

Object-oriented programming (OOP) revolutionizes software design by organizing code around objects representing entities with attributes and behaviors. This approach mirrors real-world systems, enhancing code reuse and maintainability.

Fundamental Concepts of OOP

Key concepts include classes (blueprints for objects), objects (instances of classes), encapsulation (hiding internal details), inheritance (deriving new classes from existing ones), and polymorphism (objects taking many forms). These enable complex system modeling in software like banking applications.

Benefits for Kenyan Enterprises

OOP facilitates modular programming that supports collaborative development and easier maintenance. For example, a SACCO’s loan management software can use classes for members, loans, and repayments, allowing independent updates without disrupting the whole system.

Popular Object-Oriented Languages

Languages such as Java, C++, and C# are widely used in Kenyan universities and financial institutions for developing scalable applications. Java’s platform independence makes it suitable for diverse hardware environments found in county offices.

Challenges in Adoption

OOP requires a deeper understanding of design principles, which may pose a learning curve for beginners. Additionally, performance overhead due to abstraction might affect applications requiring high speed, such as real-time hotel booking systems.

Practical Application

In a hotel management system, OOP can represent rooms, guests, and reservations as objects, simplifying complex operations like booking, billing, and reporting with reusable and extendable code structures.

1.1.4 Functional Programming

Functional programming emphasizes computation through pure functions and immutable data, reducing side effects and improving code predictability. This paradigm is gaining traction in data-intensive environments.

Core Principles of Functional Programming

Functions are first-class citizens that can be passed around as arguments or returned as values. The paradigm avoids mutable state and side effects, which enhances reliability in concurrent and parallel processing environments.

Advantages in Data Handling

Functional programming is well-suited for applications involving large-scale data transformations, such as analyzing agricultural yields or processing tax records at KRA. Its declarative nature simplifies reasoning about code behavior.

Functional Programming Languages

Languages like Haskell, Scala, and F# embody functional principles. Even multi-paradigm languages like Python and JavaScript support functional features, enabling flexible programming in sectors such as retail analytics.

Limitations and Considerations

The abstract nature of functional programming can be challenging for beginners accustomed to imperative styles. Moreover, performance can be impacted by heavy use of recursion and immutable data structures.

Example in Practice

A county government environmental department using NEMA data might employ functional programming techniques to process sensor data streams for pollution monitoring, ensuring accurate and efficient analysis.

Practice Questions

  1. Explain the main differences between procedural and object-oriented programming paradigms. (6 marks)
  2. Describe five key characteristics of object-oriented programming and how they benefit large software projects. (10 marks)
  3. Discuss the advantages of functional programming in data analysis with reference to a Kenyan agricultural cooperative. (8 marks)
  4. Identify three popular procedural programming languages and explain their typical applications in Kenyan industries. (6 marks)
The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒1.2 Programming Paradigms

Programming paradigms represent the fundamental styles or approaches used to write computer programs. In Kenya’s diverse professional sectors such as county government offices, hospitals, banks, and agricultural cooperatives, understanding different paradigms…

🔒1.3 Program Development Life Cycle

The program development life cycle (PDLC) provides a structured approach to creating software applications that meet user needs and quality standards. In diverse Kenyan sectors like education, healthcare, and finance, applying a disciplined life cycle enhances…

🔒1.4 Selecting design tools based on user requirements and project complexity

In Kenya’s diverse professional environments, choosing the appropriate design tools for programming projects is a critical decision that directly influences the success and maintainability of software solutions. Whether developing a data management system for…

Chapter Summary

This chapter explored the fundamental concepts of computer programming, beginning with an examination of different programming language types including procedural, object-oriented, and functional languages. It discussed how these categories influence the way programmers approach problem-solving and code structure. The chapter then introduced programming paradigms such as imperative and declarative, emphasizing the importance of selecting an appropriate paradigm to suit specific project requirements. A detailed overview of the program development life cycle highlighted key stages such as planning, design, and implementation, alongside best practices for tailoring these stages to meet work demands effectively. Various program design tools including algorithms, flowcharts, wireframes, pseudocodes, and decision tables or trees were presented as essential aids in organizing and visualizing program logic. Finally, the chapter addressed how to select suitable design tools by considering user needs and the complexity of the project to ensure efficient and clear program development. This comprehensive foundation supports the practical application of structured programming principles in diverse computing environments.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. Identify the main difference between procedural and object-oriented programming languages. (3 marks)
  2. Which programming paradigm focuses on describing what the program should accomplish rather than how to accomplish it? (2 marks)
🔒20 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. Differentiate between procedural and object-oriented programming languages, giving an example of an application in a county government office for each. (4 marks)
  2. Explain the main characteristics of functional programming and discuss why it might be suitable for data analysis tasks in a university research department. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Classify Programming Languages by Type and Explain Characteristics

Software Development · Level 6
Structured Programming
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Prepare a classification report of 10 given programming languages by type, including their key characteristics, in a Word document of at least 2 pages.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Computer with internet accessPrinted reference list of programming languages
Word processing softwareA4 writing papers
Pen
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Computer with internet access1 Pc per Candidate
2Word processing software (e.g., Microsoft Word or LibreOffice Writer)1 Pc per Candidate
3Printed reference list of programming languages1 Set per Candidate
4Pen and A4 writing papers5 Sheets per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Classification of Programming Languages
Created a folder named "Programming_Language_Classification" on the desktop
(Award 1 mark if folder created correctly)
1
Selected 10 programming languages from the provided list
(Award 1 mark each for selecting 10 distinct languages)
2
Correctly classified each language into its type (e.g., Procedural, Object-Oriented, Functional, Scripting, Markup)
(Award 1 mark per correctly classified language)
10
Described key characteristics of each programming language type clearly
(Award 2 marks for each clear, accurate description for 5 language types)
10
Used appropriate terminology and examples in explanations
(Award 1 mark for each example or correct term used)
5
Compiled the classification and explanations into a Word document
(Award 5 marks if document is well organized, at least 2 pages, and saved correctly)
5
Reviewed and proofread the document for spelling and grammar errors
(Award 2 marks if document is free from spelling and grammatical errors)
2
Sub-Total35
PRODUCT CHECKLIST
Final Word document contains a list of 10 programming languages classified correctly by type
(Award 5 marks if all 10 languages are correctly listed and classified)
5
Document includes clear, concise descriptions of characteristics for each programming language type
(Award 5 marks if descriptions accurately reflect key features)
5
Document is formatted neatly with headings, consistent font, and logical flow
(Award 3 marks for professional and readable formatting)
3
Document is saved in Word format (.doc or .docx) and named "Programming_Language_Classification.docx"
(Award 2 marks for correct file format and naming)
2
Sub-Total15
GRAND TOTAL50
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Develop an Object-Oriented C# Console Application to Manage Student Records

Software Development · Level 6
Structured Programming
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Develop a C# console application with classes and objects to manage student records including name, admission number, and marks for five subjects; application must include methods for calculating total and average marks, and display a formatted report.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Visual Studio Community Edition.NET SDK
Visual Studio Code with C# extensionDesktop or Laptop Computer
Snipping Tool or Screenshot SoftwarePrinting Paper
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Visual Studio Community Edition1 Pc per Candidate
2.NET SDK1 Pc per Candidate
3Visual Studio Code with C# extension1 Pc per Candidate
4Desktop or Laptop Computer1 Pc per Candidate
5Snipping Tool or Screenshot Software1 Pc per Candidate
6Printing Paper5 Sheets per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Project Setup and Folder Organization
Created a folder named "StudentRecordsApp" on the desktop
(Award 1 mark if folder created correctly)
1
Created a new C# Console Application Project named "StudentRecordsApp"
(Award 1 mark if project created and named correctly)
1
Project compiles successfully on first run
(Award 1 mark if project compiles without errors)
1
Sub-Total3
TASK 2: Class Design and Object-Oriented Principles Implementation
Declared a class named "Student" with appropriate access modifiers
(Award 2 marks if class declared correctly)
2
Declared private fields for student name, admission number, and marks for five subjects
(Award 3 marks if fields declared with correct data types and access)
3
Implemented public properties or methods to get and set the fields
(Award 3 marks if encapsulation implemented correctly)
3
Implemented a method to calculate total marks
(Award 2 marks if method calculates total correctly)
2
Implemented a method to calculate average marks with correct type casting
(Award 2 marks if average calculation is correct)
2
Created at least two student objects and initialized with sample data
(Award 2 marks if objects created and initialized properly)
2
Sub-Total14
TASK 3: User Interaction and Input Validation
Prompted user to enter student details (name, admission number, and marks)
(Award 1 mark each for clear prompts for name, admission number, and marks)
3
Declared variables with correct data types for user inputs
(Award 2 marks if variables declared correctly)
2
Read and converted inputs to appropriate types (e.g., int for marks)
(Award 3 marks if inputs read and converted correctly)
3
Implemented error handling to manage invalid inputs gracefully
(Award 4 marks if invalid entries are handled without crashing)
4
Sub-Total12
TASK 4: Displaying Results and Code Documentation
Displayed student report using string interpolation with clear labels
(Award 3 marks if output uses $" {variable} " syntax correctly and is clear)
3
Included a final thank you or exit message
(Award 1 mark if final message is displayed)
1
Added header comment with name, date, and purpose of the program
(Award 2 marks if header comment is complete and clear)
2
Added inline comments explaining major steps of the code
(Award 3 marks if inline comments are present and relevant)
3
Sub-Total9
TASK 5: Code Style, Testing, and Screenshots
Used consistent indentation and spacing throughout the code
(Award 2 marks if code style is consistent)
2
Avoided repetition or unnecessary code
(Award 2 marks if code is efficient and clean)
2
Tested application with at least two different sets of inputs
(Award 2 marks if testing is evident)
2
Application handles unexpected inputs without crashing
(Award 2 marks if error handling works during testing)
2
Provided at least five screenshots showing code, input prompts, and outputs
(Award 3 marks if screenshots are clear and complete)
3
Sub-Total11
PRODUCT CHECKLIST
Console application runs without errors and displays student records correctly
(Award 5 marks if application functions as specified)
5
Student class implements encapsulation, methods, and object creation properly
(Award 5 marks if object-oriented principles are applied correctly)
5
User input prompts and outputs are clear, formatted, and user-friendly
(Award 4 marks if UI is clear and well formatted)
4
Code is well documented and adheres to good programming style
(Award 5 marks if documentation and style are good)
5
Sub-Total19
GRAND TOTAL68
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒Develop and Run a Functional Programming Example Using Recursion in C#Practical 3
🔒Write an Imperative Programming Paradigm Demonstration in C#Practical 4
🔒Develop a Declarative SQL Query for Student RecordsPractical 5
🔒Select and Justify Programming Paradigm for Project ScenarioPractical 6
🔒Plan a Program Using the Development Life Cycle StagesPractical 7
🔒Adapt Program Development Life Cycle for a Mobile Banking ApplicationPractical 8
🔒Draw and Interpret Algorithm for Calculating Student GradePractical 9
🔒Develop Flowcharts and Pseudocode for Grade Calculator ProgramPractical 10
🔒Develop Decision Tables and Trees for Program LogicPractical 11
🔒Select and Justify Program Design Tools for Given Project ScenariosPractical 12
Flashcards 20 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

18 more in this section.

Create a free account
Test Yourself 20 questions Start quiz ▾
0%
0 / 2
🔒

18 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • Identify different programming language types based on what the user needs.
  • Apply programming paradigms that best fit the user's requirements.
  • Follow the program development life cycle correctly throughout a project.
  • Use program design tools that effectively meet the user's needs.

Tick each one you can genuinely do.

So, are you there yet?

You're competent when you can confidently do 50% or more of what this chapter promised.

Sign in to record how you're doing.