COURSE 1:  INTRODUCTION TO SOFTWARE ENGINEERING

Module 3: Basics of Programming

IBM AI DEVELOPER PROFESSIONAL CERTIFICATE

Complete Coursera Study Guide

Last updated:

INTRODUCTION – Basics of Programming

This module offers a comprehensive introduction to the basics of programming. In the first lesson, you will delve into the various categories of programming languages, gaining an understanding of the specific scenarios each is best suited for. You’ll also learn essential skills for planning and organizing your code effectively, setting a strong foundation for your programming practices. Moving into lesson two, you will explore fundamental programming logic and investigate key concepts such as identifiers, functions, and objects, which are crucial for developing a solid programming foundation.

Finally, the hands-on lab will provide you with practical experience as you learn how to write simple Python code, allowing you to apply the concepts and skills you’ve acquired in a real-world context. Through this module, you’ll gain a well-rounded introduction to programming, equipping you with the knowledge and practical experience necessary to begin your journey in the world of coding.

Learning Objectives

  • Identify interpreted programming languages and compiled programming languages.
  • Compare interpreted and compiled programming languages.
  • Describe query languages and assembly languages.
  • Define the two main methods of organizing and planning code and describe the advantages of each.
  • Design simple flowcharts.
  • List the differences between branching and looping.
  • Describe the purpose and use of identifiers and containers.
  • Describe the purpose and use of functions and objects.
  • Write and run simple Python code that uses variables, constants, arrays, loops, 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: Correct! Java is an example of a compiled programming language.

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: Correct! Interpreted programming languages, not compiled ones, are versatile and can be used across platforms as long as there is the correct interpreter.

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: Correct! This is the definition of a high-level programming language.

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: Correct! This is a description of a flowchart.

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: Correct! SQL is used to perform CRUD operations on data in a database.

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: Correct! A function is a piece of structured, stand-alone, and reusable code that will perform a single specific action.

2. Which of the following words is used for the data stored in an object?

  • Property (CORRECT)
  • Behavior
  • Function
  • Method

Correct: Correct! Properties are used to hold the attributes of an object.

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: Correct! A variable contains a single data item that can change during the execution of the program.

4. Which of the following is a type of programming logic?

  • Deciding
  • Moving 
  • Looping (CORRECT)
  • Hopping

Correct: Correct! Looping and branching are two types of programming logic.

5. A Boolean variable can have which of the following values?

  • 0, 1, 2 
  • 0, -1 
  • 0, 1 (CORRECT)
  • 1, 2

Correct: Correct! Boolean variables consist of 0s and 1s.

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: Correct! An identifier references a program component.

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: Correct! This statement describes interpreted programming languages.

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: Correct! It may take longer to write code in a compiled programming language, but the code will run faster because it is installed on your computer.

4. Which one of the following is an example of a low-level programming language?

  • SQL 
  • ARM (CORRECT)
  • Pascal 
  • Python

Correct: Correct! ARM is an example of a low-level programming language.

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: Correct! Boolean logic is a type of programming statement with only two values, “true” or “false”, and is used in both branching and looping programming logic.

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 are the three standpoints used for organizing code.

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: Correct! Interpreted language is also commonly referred to as scripted or scripting language.

8. Which of the following is a type of looping programming logic?

  • if 
  • while (CORRECT)
  • switch 
  • goto

Correct: Correct! While is a type of looping programming logic.

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: Correct! Using a constant for data items whose value does not change makes your code easier to read.

10. Which of the following is a software methodology that focuses on objects rather than functions?

  • Modular programming 
  • Extreme programming 
  • OOP (CORRECT)
  • SDLC

Correct: Correct! OOP, or object-oriented programming, is focused on objects rather than functions.

CONCLUSION – Basics of Programming

In conclusion, this module provides a thorough introduction to the basics of programming. By learning about the different categories of programming languages and their suitable scenarios, you’ll gain a foundational understanding of how to choose the right tools for your coding projects. Effective code planning and organization will further enhance your programming skills.

Exploring basic programming logic and concepts such as identifiers, functions, and objects will deepen your knowledge and prepare you for more advanced topics. The hands-on lab, where you write simple Python code, will solidify your understanding through practical application. This module aims to equip you with the essential knowledge and skills needed to embark on your programming journey with confidence.