Computer Programming Concepts - Learn Programming Basics
Document Details

Uploaded by NimbleMood4058
Tags
Summary
This document covers fundamental computer programming concepts, including various programming languages (procedural, functional, low-level, and high-level) and the object-oriented programming paradigm. It includes questions on computer software and concepts to help with learning to code and programming.
Full Transcript
## Computer Programming Concepts ### 1. What is computer programming? Computer programming is the process of writing instructions (code) that a computer can execute to perform specific tasks. ### 2. Discuss the following types of Computer Programming Languages with examples: i. Procedural Progr...
## Computer Programming Concepts ### 1. What is computer programming? Computer programming is the process of writing instructions (code) that a computer can execute to perform specific tasks. ### 2. Discuss the following types of Computer Programming Languages with examples: i. Procedural Programming Languages ii. Functional Programming Languages iii. Low-Level Programming Languages iv. High-Level Programming Languages #### I. Procedural Programming Languages Procedural programming languages follow a step-by-step approach where a program is divided into procedures (or functions). E.g., C. #### ii. Functional Programming Languages Functional programming languages focus on mathematical functions to perform tasks. They avoid changing variables (immutability) and emphasize pure functions, where the output depends only on the input. E.g., Haskell #### iii. Low-Level Programming Languages Low-level programming languages are closer to machine language and provide direct access to hardware. They are fast and efficient but harder to write and understand. E.g., Assembly #### iv. High-Level Programming Languages High-level programming languages are designed to be easy to read, write, and understand. They use human-like syntax and handle complex operations behind the scenes, making them more user-friendly. E.g., Python. ### 3. Discuss the concept of object-oriented programming Object-Oriented Programming (OOP) is a programming approach that organizes code into **objects**, which contain **data (attributes)** and **functions (methods)** that work on the data. It helps make programs more structured, reusable, and easier to manage. ### 4. Discuss the following features of object-oriented programming. * i. Abstraction * ii. Encapsulation * iii. Inheritance * iv. Polymorphism * **Abstraction**: Hiding unnecessary details and showing only the essential features of an object. * **Encapsulation**: Hiding an object's data and allowing access only through methods to protect it. * **Inheritance**: Allowing a class to inherit properties and methods from another class, promoting code reuse. * **Polymorphism**: Allowing a single method to behave differently depending on the object it is applied to. ### 5. What is a computer program? A computer program is a set of instructions written in a programming language that tells a computer what to do. ### 6. List down ways you use computers regularly. * Browsing the Internet – Checking emails, social media, or researching topics. * Writing Documents – Using word processors like Microsoft Word or Google Docs. * Watching Videos – Streaming movies or videos on platforms like YouTube. * Playing Games – Playing video games or mobile games. * Coding – Writing and testing programs or learning new programming languages. * Managing Files – Storing, organizing, and backing up files on the computer. ### 6. Discuss with examples the following types of computer software: 1. System Software 2. Application Software 3. Utility Software 1. **System Software** – Software that helps the computer run and manage its hardware. * Examples: Windows, Linux, macOS, Printer drivers. 2. **Application Software** – Software designed for users to perform specific tasks. * Examples: Microsoft Word, Google Chrome, Spotify. 3. **Utility Software** – Software that helps improve the computer's performance and security. * Examples: Antivirus (Avast), Disk Cleanup (CCleaner), Backup Software (Google Drive). ### 7. Discuss the following object-oriented programming concepts * **Classes** – A class is a blueprint for creating objects. It defines the attributes (data) and methods (functions) that objects will have. * **Functions (Methods)** – Functions inside a class (called methods) define the behavior of objects. They allow objects to perform actions. * **Objects** – An object is an instance of a class. It has the properties and behaviors defined in the class.