Software Development  ·  Level 6
Object Oriented Programming
Chapter 1: To apply computer programming skills
📚 5 Topics
⚑ What you will be able to do

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

  • Identify different types of programming languages based on what the user needs.
  • Apply the right programming paradigms to solve problems effectively.
  • Follow the program development life cycle accurately from start to finish.
  • Use program design tools effectively to create solutions that meet user requirements.
  • Choose the appropriate program writing tools based on the system’s needs.

These skills will help you create software that truly fits what users want, making you a valuable programmer in the real world!

Object Oriented Programming (OOP) forms a cornerstone of modern software development, enabling programmers to create modular, reusable, and maintainable code. In the Kenyan software industry, where diverse applications from banking systems to mobile platforms are rapidly evolving, mastering OOP principles is essential for delivering robust solutions. This chapter focuses on applying programming skills by exploring programming language types, criteria for language selection, and practical exercises involving class creation and collaborative development. These competencies prepare software developers to work effectively both individually and in teams, reflecting real-world software engineering practices.

1.1 Programming Language Types

Programming languages provide the tools through which developers translate human logic into instructions a computer can execute. Different languages serve varied purposes, influenced by their design paradigms, syntax, and runtime environments. Understanding language categories equips Kenyan software developers to choose appropriate tools for projects ranging from mobile apps for fintech startups to enterprise resource planning systems for county governments.

1.1.1 Overview of Programming Language Categories

Programming languages can be broadly classified into several categories, each with distinct characteristics and typical applications. This classification helps developers understand the strengths and limitations of languages within different domains.

Procedural Languages

Procedural languages focus on a sequence of instructions or procedures to perform computations. They emphasize a step-by-step approach where the program state changes through variable manipulations and function calls. Examples include C and Pascal. In Kenya, procedural languages are often used in embedded systems and legacy applications within sectors like manufacturing and telecommunications.

Object-Oriented Languages

Object-oriented languages organize code around objects representing real-world entities, encapsulating data and behaviors. Concepts such as inheritance, polymorphism, and encapsulation promote code reuse and modularity. Java, C++, and C# are prominent examples. Kenyan software firms developing scalable web applications and mobile platforms frequently adopt these languages to manage complexity.

Functional Languages

Functional languages treat computation as the evaluation of mathematical functions without mutable state or side effects. This paradigm facilitates easier reasoning and parallel execution, enhancing reliability. Examples include Haskell and Erlang. In Kenya, functional languages find niche use in telecom backend systems and data-intensive applications requiring concurrency.

Scripting Languages

Scripting languages are interpreted rather than compiled, enabling rapid development and automation of tasks. They are often dynamically typed and used for web development, system administration, and prototyping. Popular scripting languages include Python, JavaScript, and PHP. Many Kenyan startups and SMEs leverage these languages for building websites, APIs, and data analysis tools.

Markup and Query Languages

Though not programming languages per se, markup (e.g., HTML, XML) and query languages (e.g., SQL) play critical roles in structuring and accessing data. Software developers must understand these to integrate front-end interfaces and databases effectively.

1.1.2 Criteria for Selecting Languages Based on User Requirements

Choosing the right programming language depends on multiple factors related to project goals, team skills, performance needs, and deployment environments. Kenyan software developers must evaluate these criteria carefully to optimize resource use and deliver quality solutions.

Project Complexity and Scope

For large-scale enterprise systems, object-oriented languages like Java or C# provide robust frameworks and libraries facilitating modular design. Conversely, simple automation scripts may be better served by Python or Bash scripting due to their concise syntax.

Performance Requirements

Applications demanding high performance and low latency, such as real-time trading platforms or embedded systems, often require compiled languages like C or C++. For web applications where rapid development is prioritized, interpreted languages like JavaScript are preferred despite slower execution.

Development Team Expertise

A development team’s familiarity with a language directly impacts productivity and code quality. For example, a Kenyan software firm with a team experienced in Python may choose it for a new project to leverage existing skills and minimize training costs.

Platform Compatibility

Target deployment environments influence language choice. Mobile apps for Android typically use Java or Kotlin, while iOS apps require Swift or Objective-C. Cross-platform frameworks may use JavaScript or Dart. Understanding client infrastructure helps developers select compatible languages.

Community Support and Ecosystem

Languages with active communities offer extensive libraries, frameworks, and tools that accelerate development and troubleshooting. For instance, Python’s rich ecosystem supports data science and machine learning projects, which are increasingly relevant in Kenyan tech sectors.

1.1.3 Creating a Simple Class and Instantiating Objects to Demonstrate Understanding

Object-oriented programming revolves around defining classes as blueprints for objects, encapsulating attributes and methods. Writing a simple class and creating its instances illustrate fundamental OOP concepts crucial for Kenyan software developers working on applications such as customer management systems or inventory controls.

Defining a Class Structure

A class definition includes properties (attributes) describing the object's state and methods defining its behavior. For example, a Customer class in a banking application might include attributes like customerID, name, and accountBalance, alongside methods for deposit and withdrawal.

Example in Java

public class Customer {
    private String customerID;
    private String name;
    private double accountBalance;

    public Customer(String customerID, String name, double accountBalance) {
        this.customerID = customerID;
        this.name = name;
        this.accountBalance = accountBalance;
    }

    public void deposit(double amount) {
        accountBalance += amount;
    }

    public void withdraw(double amount) {
        if (amount <= accountBalance) {
            accountBalance -= amount;
        } else {
            System.out.println("Insufficient balance");
        }
    }

    public double getBalance() {
        return accountBalance;
    }
}

Instantiating Objects

Creating objects involves invoking the class constructor with specific values. For instance, instantiating a new Customer object:

Customer customer1 = new Customer("C001", "Amina Mwangi", 5000.0);
customer1.deposit(1500.0);
System.out.println("Balance: " + customer1.getBalance());

This instance represents a real customer with an initial balance, demonstrating encapsulation and interaction through methods.

Benefits of Practicing Class Creation

Hands-on practice in defining classes helps Kenyan developers internalize OOP principles, enabling them to build maintainable and scalable software components for sectors like healthcare management or educational platforms.

1.1.4 Participating in a Group Project Where Each Member Implements a Different Class Based on a Shared Design

Collaborative software development is standard in Kenya’s tech industry, where teams divide tasks to increase efficiency. Implementing different classes from a unified design teaches coordination, interface adherence, and integration skills vital for professional development.

Understanding the Shared Design

A shared design, often documented in UML diagrams or design specifications, outlines the system architecture and class relationships. Team members must thoroughly understand the design to implement their assigned classes correctly.

Division of Responsibilities

Each member focuses on a specific class, such as User, Product, or Order in an e-commerce system. This division promotes specialization and parallel progress without overlapping work.

Ensuring Interface Compatibility

Classes often interact through defined interfaces or method calls. Team members must adhere to agreed method signatures and data formats to ensure seamless integration. For example, the Order class might call methods from the Product class to retrieve pricing information.

Version Control and Collaboration Tools

Using tools like Git allows teams to manage code versions, resolve conflicts, and maintain a centralized repository. Kenyan software companies increasingly adopt such tools to coordinate development across dispersed teams.

Code Integration and Testing

After individual implementations, integrating classes into a cohesive system requires thorough testing to detect interface mismatches or logic errors. Continuous integration practices support early detection and resolution of issues.

Communication and Documentation

Regular team meetings and clear documentation help synchronize efforts, clarify ambiguities, and track progress. These practices reflect professional standards in Kenyan software development firms and foster a culture of accountability.

Practice Questions

  1. Explain the main differences between procedural and object-oriented programming languages, citing examples relevant to Kenyan software projects. (6 marks)
  2. List and explain five criteria a Kenyan software development team should consider when selecting a programming language for a new mobile application. (10 marks)
  3. Write a simple class in any object-oriented language that models a "Book" with attributes for title, author, and price, including methods to apply a discount and display details. Provide sample code for instantiating an object of this class. (10 marks)
  4. Describe the steps and challenges involved in a group project where each member implements a different class based on a shared design. How can these challenges be mitigated? (8 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 to writing software. For software development professionals in Kenya, understanding these paradigms is crucial for selecting the right tools and methodologies to deliver efficient and maintai…

🔒1.4 Program Design Tools

Program design tools are essential in structuring and planning software development projects effectively. In Kenya’s dynamic software sector, where projects range from mobile banking apps to enterprise resource systems for county governments, selecting the app…

🔒1.5 Program Writing Tools

Efficient program writing tools are critical in transforming design documents into functioning software. In Kenya’s software development ecosystem, which includes startups and established firms serving sectors like finance and education, the choice of programm…

Chapter Summary

This chapter explored various programming language types, highlighting procedural, object-oriented, and functional categories, and discussed how to select a language based on specific user requirements. It then examined common programming paradigms, including imperative and declarative approaches, emphasizing the importance of choosing the right paradigm to suit project needs. The program development life cycle was described with its key stages such as planning, design, and implementation, alongside best practices for adapting these stages to different work contexts. Design tools like algorithms, flowcharts, wireframes, pseudocode, and decision tables were introduced, with guidance on selecting appropriate tools depending on project complexity and user requirements. The chapter also covered program writing tools and integrated development environments, evaluating options like Visual Studio and Eclipse based on system needs and developer preferences. Practical skills were reinforced through activities involving creating simple classes, instantiating objects, and engaging in collaborative projects where team members implement different classes from a shared design. Together, these topics provide a comprehensive foundation for applying computer programming skills effectively.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. Which of the following best describes a procedural programming language? (2 marks)
    a) Focuses on objects and their interactions
    b) Executes instructions sequentially using procedures or routines
    c) Emphasizes immutability and pure functions
    d) Uses declarative statements to define logic

  2. Identify two key differences between object-oriented and functional programming paradigms. (4 marks)

🔒20 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. Explain the main difference between procedural and object-oriented programming languages, using an example relevant to a Kenyan banking application. (4 marks)
  2. Identify three criteria that a software developer in a Nairobi-based fintech company should consider when selecting a programming language for a mobile payment system. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Classify Programming Languages into Procedural, Object-Oriented, and Functional Categories

Software Development · Level 6
Object Oriented Programming
PRACTICAL ASSESSMENT
TIME: 3 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Classify the following programming languages into procedural, object-oriented, and functional categories using the provided classification table template (table size approx. A4).
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Computer with Windows 7 OS or higherList of programming languages for classification
Installed Java Development Kit (JDK)Printed classification table template
NetBeans or Eclipse IDE
Flash disk or CD RW
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Computer with Windows 7 OS or higher1 Pc per Candidate
2Installed Java Development Kit (JDK)1 Pc per Candidate
3NetBeans or Eclipse IDE1 Pc per Candidate
4Flash disk or CD RW1 Pc per Candidate
5List of programming languages for classification1 Set per Candidate
6Printed classification table template1 Sheet per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Identify Programming Language Types
Candidate reads and understands the list of programming languages
(Award 2 marks for correctly identifying all languages)
2
Candidate uses IDE or notes to research language types if unsure
(Award 2 marks for effective use of IDE or research)
2
Candidate classifies each language into correct category: Procedural, Object-Oriented, or Functional
(Award 1 mark per correctly classified language, total 6 marks)
6
Sub-Total10
TASK 2: Document Classification Results
Candidate fills the classification table template neatly and legibly
(Award 3 marks for clear and complete documentation)
3
Candidate saves and backs up the completed classification table on flash disk
(Award 2 marks for correct saving and backup)
2
Sub-Total5
PRODUCT CHECKLIST
Classification table accurately lists languages under correct categories (Procedural, Object-Oriented, Functional)
(Award up to 10 marks for accuracy and completeness of classification)
10
Classification table is neat, legible, and properly formatted on A4 sheet
(Award up to 5 marks for presentation and formatting)
5
Sub-Total15
GRAND TOTAL30
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Select appropriate programming language based on user requirements

Software Development · Level 6
Object Oriented 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 written report recommending a programming language for a business application with key criteria and justification, approximately 1000 words.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Computer installed with Windows 10 OS or higherFlash disk
Internet access for research
Office suite software (Word Processor, Spreadsheet)
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Computer installed with Windows 10 OS or higher1 Pc per Candidate
2Internet access for research1 Pc per Candidate
3Office suite software (Word Processor, Spreadsheet)1 Pc per Candidate
4Flash disk1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Analyze user requirements
Identified and listed user requirements clearly
(Award 3 marks for clear, complete listing of requirements or 0)
3
Researched programming languages suitable for the requirements
(Award 4 marks for thorough research covering at least 3 languages or 0)
4
Evaluated languages against criteria such as performance, ease of use, platform compatibility, and community support
(Award 5 marks for detailed evaluation with relevant criteria or 0)
5
Sub-Total12
TASK 2: Select and justify programming language
Selected the most appropriate programming language based on analysis
(Award 5 marks for a justified, logical selection or 0)
5
Prepared a written report with clear reasoning and supporting facts
(Award 6 marks for a well-structured report with justification or 0)
6
Included recommendations for future scalability and maintenance
(Award 4 marks for relevant recommendations or 0)
4
Sub-Total15
TASK 3: Present deliverable
Formatted report professionally with headings and bullet points
(Award 3 marks for professional formatting or 0)
3
Saved and submitted report on flash disk in Word or PDF format
(Award 2 marks for correct file format and submission or 0)
2
Sub-Total5
PRODUCT CHECKLIST
Report contains all required sections: user requirements, language options, evaluation, selection, justification, and recommendations
(Award 8 marks for complete, coherent report or 0)
8
Report length approximately 1000 words
(Award 4 marks for meeting length requirement or 0)
4
Report free from spelling and grammatical errors
(Award 3 marks for error-free writing or 0)
3
Sub-Total15
GRAND TOTAL47
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

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

Create a free account
🔒Explain and Differentiate Programming Paradigms with ExamplesPractical 3
🔒Select and justify programming paradigm for a car rental system projectPractical 4
🔒Plan Program Development Life Cycle for Library Management SystemPractical 5
🔒Adaptation of Program Development Life Cycle for Specific Work RequirementsPractical 6
🔒Design Algorithm and Flowchart for Student Grade EvaluationPractical 7
🔒Develop pseudocode and decision table/tree for loan eligibilityPractical 8
🔒Selection of Program Design Tools Based on Project ComplexityPractical 9
🔒Install and Configure Visual Studio Code IDE for Java DevelopmentPractical 10
🔒Evaluate and compare programming tools for a system development projectPractical 11
🔒Create and demonstrate a simple class with object instantiation in JavaPractical 12
🔒Implement and Demonstrate Class Methods and Properties in JavaPractical 13
🔒Group Project: Implementing Assigned Classes for a Library Management SystemPractical 14
🔒Integrate and Test Multiple Classes in a Java OOP ProjectPractical 15
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 types of programming languages based on what the user needs.
  • Apply the right programming paradigms to solve problems effectively.
  • Follow the program development life cycle accurately from start to finish.
  • Use program design tools effectively to create solutions that meet user requirements.
  • Choose the appropriate program writing tools based on the system’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.