Software Development  ·  Level 5
Structured Programming
Chapter 2: Write program Code
📚 3 Topics
⚑ What you will be able to do

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

  • choose the right program writing tools based on the system requirements.
  • declare identifiers accurately following the program design specifications.
  • initialize variables and constants correctly according to the program design specifications.

Mastering these skills will help you write clear, efficient programs that work exactly as needed in real-world projects.

Programming is a fundamental skill across all professional fields in Kenya, enabling automation, data management, and problem-solving in sectors ranging from healthcare to finance and agriculture. Writing efficient and readable program code is essential for developing software solutions that meet organizational needs. This chapter focuses on the tools available for writing program code and how to select the most appropriate tools based on system capabilities and developer preferences.

2.1 Program Writing Tools

Programming tools facilitate the creation, testing, and debugging of software applications. In Kenya, professionals in diverse sectors such as county hospitals, universities, banks, and retail businesses rely on these tools to develop solutions tailored to their operational challenges. Selecting the right programming environment enhances productivity and code quality, directly impacting project success.

2.1.1 Common Program Writing Tools and IDEs

Integrated Development Environments (IDEs) and text editors are the primary tools programmers use to write and manage code. IDEs combine code editing, compiling, debugging, and project management into a single interface, streamlining the development process. Various IDEs cater to different programming languages and user needs.

Code::Blocks

Code::Blocks is a free, open-source IDE primarily used for C, C++, and Fortran programming. It offers a customizable interface and supports multiple compilers, making it popular among students and professionals in academic and business sectors such as universities and SACCOs.

Turbo C

Turbo C is a classic IDE for C programming, known for its simple interface and fast compilation. It remains in use in some Kenyan TVET colleges for teaching foundational programming concepts, although it lacks support for modern operating systems and advanced features.

Eclipse

Eclipse is a versatile, open-source IDE widely used for Java development but also supports other languages through plugins. Its robust debugging tools and extensibility make it a preferred choice in sectors like banking and county government offices where complex applications are developed.

Visual Studio Code

Visual Studio Code (VS Code) is a lightweight, open-source code editor with powerful extensions for various programming languages. Its user-friendly interface and integrated Git support have made it popular among software developers in Kenyan tech startups and retail businesses.

Sublime Text

Sublime Text is a fast, proprietary text editor favored for its simplicity and powerful editing features. It is widely used by programmers who prefer a distraction-free environment, including those developing web applications for hotels and tourism enterprises.

2.1.2 Evaluating Tools Based on System Requirements and Developer Preferences

Choosing the appropriate programming tool involves assessing both technical specifications and personal or organizational needs. This evaluation ensures compatibility with existing infrastructure and aligns with developer skills and project demands.

System Compatibility

Developers must consider the operating system and hardware specifications of their workstations. For instance, Turbo C may not run efficiently on modern Windows versions used in county government offices, while VS Code supports Windows, macOS, and Linux, accommodating diverse environments.

Language Support

The programming language required for a project dictates the choice of tool. Eclipse is optimal for Java projects common in financial institutions like banks, whereas Code::Blocks suits C/C++ projects in agricultural research institutions developing data analysis software.

Feature Set

Advanced features such as code completion, debugging, version control integration, and plugin availability influence tool selection. Visual Studio Code offers extensive plugins and Git integration, beneficial for collaborative projects in retail chains managing inventory systems.

User Experience

Developer familiarity and comfort with an IDE impact productivity. A programmer at a university developing educational software may prefer the straightforwardness of Sublime Text, while a developer at a county referral hospital working on complex health information systems might choose Eclipse for its debugging capabilities.

Cost and Licensing

Budget constraints affect tool choice, especially in non-profit organizations and small businesses. Open-source tools like Code::Blocks and VS Code eliminate licensing fees, making them attractive for cooperative societies and small-scale farms developing basic management systems.

Practice Questions

  1. List and explain five features that make Eclipse a preferred IDE for complex application development in Kenyan county government offices. (10 marks)
  2. Discuss how system compatibility influences the choice of programming tools in Kenyan SACCOs. (8 marks)
  3. Compare Turbo C and Visual Studio Code in terms of their suitability for modern programming projects in Kenyan universities. (12 marks)
  4. Explain the importance of language support when selecting a programming tool, providing examples from Kenyan banking and agricultural sectors. (10 marks)
  5. Identify and explain five factors that a software developer in a retail business should consider when choosing a programming tool. (10 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
🔒2.2 Declaring Identifiers

An identifier is the name a programmer gives to a program element such as a variable, a function or an array. The compiler uses identifiers to find the memory or the code that each name refers to, so every identifier must be declared (given a name and, where r…

🔒2.3 Initializing Variables and Constants

Initialising a variable means giving it its first value before the program reads it. A constant must receive its value at the moment it is declared, because it cannot be changed afterwards. In C, a local variable that is not initialised holds whatever bits wer…

Chapter Summary

This chapter explored the essential tools and environments used for writing structured program code, highlighting popular integrated development environments such as Code::Blocks, Turbo C, and Eclipse. It emphasized the importance of selecting appropriate programming tools based on system requirements and the preferences of developers to ensure efficient coding workflows. The chapter then focused on declaring identifiers, detailing the different types including variables, functions, and arrays, and underscored the need to align these identifiers with the overall program design. Guidance was provided on establishing consistent naming conventions to improve code readability and maintainability. Furthermore, the chapter addressed the critical role of initializing variables and constants correctly, presenting various techniques tailored to design specifications and illustrating both proper and improper initialization through code examples. Best coding practices were discussed, including the use of comments, proper indentation, and organizing code into logical blocks to enhance clarity and debugging. Finally, the chapter recommended practical workshops to reinforce the understanding and application of variable and constant initialization methods in programming.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. Which of the following is NOT typically considered an Integrated Development Environment (IDE)? (2 marks)
    a) Code::Blocks
    b) Turbo C
    c) Microsoft Word
    d) Eclipse

  2. Explain why evaluating program writing tools based on system requirements is important. (3 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 role of Integrated Development Environments (IDEs) such as Code::Blocks and Eclipse in improving programming productivity at a county government office. (4 marks)
  2. Describe three factors a software developer at a SACCO should consider when selecting a program writing tool based on system requirements. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Installation and Configuration of IDE with Basic Program Development

Software Development · Level 5
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.  Install and configure Visual Studio Community Edition IDE on a laptop, then create, write, and save a C# console program file named 'HelloWorld.cs' that displays a greeting message.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Laptop or Desktop ComputerUSB Flash Drive 8GB
Internet ConnectionPower Source (Electricity)
Visual Studio Community Edition Installer
Text Editor (Notepad++)
Snipping Tool
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Laptop or Desktop Computer1 Pc per Candidate
2Internet Connection1 Connection per Candidate
3Visual Studio Community Edition Installer or Eclipse IDE Installer1 Installer per Candidate
4Text Editor (Notepad++ or similar)1 Pc per Candidate
5Snipping Tool or Screenshot Software1 Pc per Candidate
6USB Flash Drive 8GB1 Pc per Candidate
7Power Source (Electricity)Continuous supply
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: IDE Installation and Configuration
Candidate wears appropriate PPE (e.g., anti-static wrist strap if available)
(Award 1 mark if PPE is used or acknowledged)
1
Downloaded or used provided Visual Studio Community Edition installer
(Award 2 marks if installer obtained correctly without errors)
2
Installed IDE successfully without errors
(Award 3 marks if installation completes without error messages)
3
Configured IDE for C# development (including .NET SDK installation)
(Award 3 marks if C# environment is set up correctly)
3
Opened IDE and created a new C# Console Application project
(Award 2 marks if project creation is successful and named 'HelloWorld')
2
Enabled IDE customization features: line numbers, IntelliSense, error list, output window
(Award 1 mark each feature enabled)
4
Captured screenshots of IDE installation, configuration, and customization
(Award 1 mark each for three relevant screenshots)
3
Saved screenshots in USB flash drive folder named 'IDE_Setup'
(Award 2 marks if screenshots are saved correctly for verification)
2
Sub-Total20
TASK 2: Program Writing and Saving
Created a new C# console program file named 'HelloWorld.cs'
(Award 2 marks if file is named correctly and created in the project)
2
Wrote code to display a greeting message 'Hello, Kenya TVET!'
(Award 3 marks if message is displayed correctly on console)
3
Used correct C# syntax including namespace, class, and Main method
(Award 4 marks for correct program structure without errors)
4
Compiled and ran the program successfully
(Award 3 marks if program compiles and runs without errors)
3
Saved the program file in the project directory
(Award 2 marks if file is saved properly)
2
Captured and saved screenshot of program code and output
(Award 2 marks each for code and output screenshots saved)
4
Sub-Total18
PRODUCT CHECKLIST
IDE installed and configured correctly for C# development
(Award 5 marks if IDE setup allows C# programming without errors)
5
Program file 'HelloWorld.cs' created, saved, and runs correctly displaying the greeting
(Award 5 marks if program output matches expected greeting message)
5
Screenshots of IDE setup and program output are clear and complete
(Award 4 marks if screenshots demonstrate all key steps clearly)
4
Sub-Total14
GRAND TOTAL52
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Declare Variables Using Correct Identifiers in C# Console Application

Software Development · Level 5
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.  Write a C# console application project named 'VariableDeclarationApp' that declares at least five variables using appropriate identifiers and data types as per the design specifications.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Visual Studio Community EditionWord Processor
.NET SDKSnipping Tool
Computer with Windows OS
Keyboard and Mouse
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Visual Studio Community Edition1 Pc per Candidate
2.NET SDK1 Pc per Candidate
3Computer with Windows OS1 Pc per Candidate
4Keyboard and Mouse1 set per Candidate
5Word Processor1 Pc per Candidate
6Snipping Tool1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Project Setup and Variable Declaration
Created a folder named 'VariableDeclarationApp' on the desktop
(Award 1 mark if folder created correctly)
1
Created a new C# Console Application project with the name 'VariableDeclarationApp'
(Award 2 marks if project named correctly and compiles on first run)
2
Declared at least five variables with appropriate identifiers following naming conventions
(Award 1 mark each for correct identifier, type, and alignment with design)
3
Used correct data types for variables as per design specifications
(Award 2 marks if variable types are appropriate and correctly declared)
2
Code compiles without errors after variable declarations
(Award 2 marks for error-free compilation)
2
Sub-Total10
TASK 2: Code Documentation and Style
Included header comment with candidate name, date, and purpose
(Award 2 marks if header comment is complete and clear)
2
Used inline comments explaining the purpose of each variable declaration
(Award 2 marks for clear and relevant inline comments)
2
Applied consistent indentation and spacing throughout the code
(Award 2 marks for consistent and readable code style)
2
Avoided repetition or unnecessary code in variable declarations
(Award 2 marks for clean and efficient code)
2
Variable names follow C# naming conventions (camelCase for variables)
(Award 2 marks for adherence to naming conventions)
2
Sub-Total10
TASK 3: Testing and Output Verification
Tested the program to ensure variables hold expected values
(Award 2 marks for successful testing with expected results)
2
Handled invalid variable identifiers gracefully (e.g. no use of reserved keywords)
(Award 2 marks if code avoids invalid identifiers and errors)
2
Captured and saved screenshots of code and output showing variable declarations
(Award 3 marks for clear screenshots showing code and successful compilation)
3
Saved screenshots in 'VariableDeclarationApp' folder for printing or sharing
(Award 1 mark if screenshots are properly saved in the folder)
1
Sub-Total8
PRODUCT CHECKLIST
Correctly declared variables with appropriate identifiers and data types as per design specifications
(Award 7 marks for correctness, appropriateness, and adherence to specifications)
7
Code compiles and runs without errors
(Award 5 marks for successful compilation and execution)
5
Code is well documented and styled according to C# standards
(Award 5 marks for clear documentation and consistent code style)
5
Sub-Total17
GRAND TOTAL45
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

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

Create a free account
🔒Declare and Implement Functions with Proper Identifiers in C#Practical 3
🔒Declare and Initialize Arrays with Appropriate Identifiers in C#Practical 4
🔒Develop a Naming Convention Guide for Identifiers in Structured ProgrammingPractical 5
🔒Evaluate and Correct Identifier Usage in Program Code SnippetsPractical 6
🔒Initialize Variables and Constants in C# Console ApplicationPractical 7
🔒Initializing Constants in C# Console ApplicationPractical 8
🔒Demonstrate Incorrect Initialization and Debugging of C# Code SnippetsPractical 9
🔒Add meaningful comments to improve program code readability and maintainabilityPractical 10
🔒Proper Indentation of Provided Unindented C# ProgramPractical 11
🔒Structuring Program Blocks Using Indentation and Braces in C#Practical 12
🔒Conduct a Workshop on Variable and Constant Initialization Techniques in C#Practical 13
🔒Evaluate and Report on IDE Suitability for a Specified System EnvironmentPractical 14
🔒Declare and Initialize Variables, Constants, Arrays, and Functions in C#Practical 15
Flashcards 20 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

18 more in this section.

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

15 more in this section.

Create a free account
Am I competent?

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

  • choose the right program writing tools based on the system requirements.
  • declare identifiers accurately following the program design specifications.
  • initialize variables and constants correctly according to the program design specifications.

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.