This module introduces the very basics of programming. In the first lesson, learners will identify different programming languages that describe when and where they best apply; this is followed up by developing skills required for planning and organizing code which would serve as a foundation for good programming practices. Lesson two progresses to logic that underpins programming at the rudimentary level, including terms like identifiers, functions, and objects-all critical tenets of an unshakeable programming foundation.
Hands-on practice with lab experiments in the application of learning involves writing basic Python codes which are applied practically in the real world. At the end of this module, you will have a holistic introductory orientation into programming-in the theoretical and practical experiences of starting a coding journey.
Learning Objectives
Recognize the interpreted and compiled programming languages.
Discuss the differences that show between interpreted and compiled programming languages.
Explain query languages and assembly languages.
Define and describe the two organization and planning methods of code with the advantages of both.
Simple flowcharts can be made.
Differentiate between branching and looping.
State what identifiers and containers would be.
State what functions and objects would be.
Write and execute simple Python code making use of variables, constants, arrays, looping, and conditional logic.
PRACTICE QUIZ: PROGRAMMING LANGUAGES AND ORGANIZATION
1. Which one of the following is an example of a compiled programming language?
JavaScript
Java (CORRECT)
HTML
Python
Correct: It is true! An straightforward programming language; As an instance, it is Java, which is first compiled and then executed on JVM (Java Virtual Machine) via an intermediate step in the form of bytecode.
2. True or false? Compiled programming languages are versatile and can be used across platforms as long as there is the correct interpreter.
True
False (CORRECT)
Correct: An interpreted programming language. A programming language is usually versatile in running on various platforms with proper interpreter existing.
3. True or false? A high-level programming language uses the common English language to make its code more understandable and to increase the speed of coding and debugging programs.
True (CORRECT)
False
Correct: Right! This characterizes a programming language at a high level, which is user-friendly and closer to human language, making it easier to write and comprehend the code.
4. Which of the following statements about a flowchart is correct?
A flowchart is more efficient than using pseudocode for large programming projects.
A flowchart is a basic, high-level description of an algorithm.
A flowchart helps explain exactly what each line of a program should do.
A flowchart is a pictorial representation of an algorithm, showing the steps of the algorithm as boxes of various shapes and colors connected by arrows. (CORRECT)
Correct: Exactly True: It’s a flowchart, a graphical tool that uses different signs to represent the sequence of steps or decisions involved in a process or system.
5. Which one of the following statements about the SQL language is true?
It is used for querying non-relational data.
It is an assembly language.
It is used to create, read, update, and delete data in a database. (CORRECT)
It is written in binary (0s and 1s).
Correct: As a rule, data would be used with SQL to execute the transactional function of CRUD (Create, Read, Update, and Delete) in a database, which would make it more available and manageable.
PRACTICE QUIZ: INTRODUCTION TO PROGRAMMING CONCEPTS
1. Which of the following is a piece of structured, stand-alone, and reusable code that will perform a single specific action?
An array
A function (CORRECT)
A vector
A container
Correct: That is right! A function is an encapsulated and reusable piece of code written for doing a certain action or task by itself.
2. Which of the following words is used for the data stored in an object?
Property (CORRECT)
Behavior
Function
Method
Correct: Correct! Properties can be defined as the values that present specific characteristics of an object, denoting its state or describing its features.
3. Which of the following identifiers contains a single data item that can change value during the execution of the program?
Constant
Vector
Variable (CORRECT)
Array
Correct: Exactly! A variable may hold only a single data item and whose value is subject to change during the execution of a program.
4. Which of the following is a type of programming logic?
Deciding
Moving
Looping (CORRECT)
Hopping
Correct: Right! Looping and branching are two basic programming logic controls for the flow of a program.
5. A Boolean variable can have which of the following values?
0, 1, 2
0, -1
0, 1 (CORRECT)
1, 2
Correct: Indeed! Boolean variable reflects logical value as either of the two states which are usually represented as 0 for false, and 1 for true.
QUIZ: BASICS OF PROGRAMMING
1. Which of the following is the generic term for referencing a program component such as a stored value, method, interface, or class by a custom-named label?
Variable
Container
Constant
Identifier (CORRECT)
Correct: That ‘s right! An identifier is a name used to identify a program element: for example, a variable. Its purpose is to provide a reference in code to the underlying object that can be manipulated.
2. Which one of the following applies to interpreted programming languages?
More difficult to write in, but creates faster applications
Better for programs installed on the computer or device
Available to users who have the same operating system or a device that understands the same language
A smaller program, normally scripted code, that must be created and repeated every time the code is run (CORRECT)
Correct: Right! This statement refers to interpreted programming languages, where instead of the code being compiled into machine code beforehand, it runs directly under an interpreter.
3. Which one of the following applies to a compiled programming language compared to an interpreted language?
Creates a smaller program, normally using scripted code
Takes longer to write the code, but it runs faster (CORRECT)
Better for websites and smaller processes that need to be repeated
Easier to learn and use, but requires an interpreter that can translate the source code into machine code
Correct: That’s right! Writing code in a compiled programming language can take longer, but the final product-the executable code-runs faster because it’s translated directly into machine code and executed natively on your computer without needing an interpreter.
4. Which one of the following is an example of a low-level programming language?
SQL
ARM (CORRECT)
Pascal
Python
Correct: In fact, ARM is not a programming language; ARM refers to a family of computer processors based on the ARM architecture. However, as it is usually related to low-level programming due to its close association with machine code and assembly language for system programming, ARM is indeed discussed under that category. Assembly language and machine code are considered low-level because they are not directly related to operating systems and require knowledge of the hardware architecture to interpret them correctly.
5. Which of the following is a type of programming logic with only two values, “true” or “false”, and is used in both branching and looping programming logic?
Branching statements
Boolean expression (CORRECT)
“if-then-else” statement
“And-do-while” loop
Correct: The statement is correct.Boolean logic consists factor of programming logic driven by two values, true and false. It determines branching (i.e., decision-making) as well as looping (repeating actions) in programming.
6. What are the three key standpoints for organizing code?
Readability, scalability, and accessibility (CORRECT)
Readability, maintainability, and accessibility
Maintainability, accessibility, and scalability
Readability, maintainability, and scalability
Correct: These represent the three different outlooks through which coding or structuring is done.
7. Which of the following is also often referred to as a scripting language?
An interpreted programming language (CORRECT)
An assembly programming language
A query language
A compiled programming language
Correct: They are generally termed scripting languages as they are quite often used for writing scripts that run through interpreters instead of being compiled into machine codes.
8. Which of the following is a type of looping programming logic?
if
while (CORRECT)
switch
goto
Correct: “The “while” loop is actually one kind of loop used in programming which keeps executing the instructions that are contained in the code block until the defined condition becomes false”.
9. Which of the following is the best type of identifier for a data item whose value does not change?
Array
Constant (CORRECT)
Vector
Variable
Correct: Certainly! This practice of assigning constants to fixed values makes one’s code more interpretive and manageable. It gives a good perspective for understanding the meaning attached to that value or prevents unintentional changes to such value.
10. Which of the following is a software methodology that focuses on objects rather than functions?
Modular programming
Extreme programming
OOP (CORRECT)
SDLC
Correct: Indeed! OOP allows programs to be built around the concept of a particular object representing a particular entity in the real world associated with its specific attributes and methods rather than merely working on functions or procedures. It will organize the entire code in a more modular and reusable form.
CONCLUSION – Basics of Programming
To sum up, the course is an extensive introduction to the fundamentals of programming. By learning about different types of programming language classes and how each is best suited to fulfill certain tasks, you will get a good understanding of how to choose the right tool for your project. Learning to plan and organize your code judiciously will further help your programming skills.
You will learn essential programming terms-those that refer to identifiers, functions, and objects-which ought to prepare the ground on which to tread on more technical topics. The practical laboratory experience of writing elementary Python code is a hands-on reinforcement of these ideas through practice. It is against this background that this module aims at equipping you with the basic knowledge and skills to commence your programming adventure confidently.