IoT Connecting Things 2.0 – Chapter 3 Quiz Answers

1. What tool can be used on a Linux device to compare all installed software against a repository index, to download updates, and to install them automatically?

  • Blockly
  • improved C Shell (tcsh)
  • Arduino
  • package manager system

Explanation: A package manager can be used to upgrade programs and the Linux operating system. Package managers allow users to compare installed software versions against a repository index and then download and automatically install all updated software programs.

2. Match the Linux administrative command to the function it performs. (Not all options are used.)

cd –> change the current directory

cp –> copy a file or files from source to destination

mv –> move a file or files to a different directory

rm –> remove a file or files

mkdir –> create a directory under the current directory

Other Incorrect Match Options:
modify file permissions

3. Fill in the blank.
A computer ___ is a set of ordered instructions created to accomplish a specific task.

Correct Answer:

  • program
  • code
  • software
  • software program

Explanation: A computer program, also called code, is a set of ordered instructions created to accomplish a specific task.

4. A user is using Blockly to program a process to find the next 100 prime numbers after 2. Which block is best used for the task?

  • FOR block
  • WHILE block
  • PRIME block
  • IF-THEN block

Explanation: FOR loop blocks are used to repeat the execution of a specific block of code for a specific number of times. It is best used if the number of repetitions is known. In this case, the repetition number is 100. The FOR block can execute 100 times, each time to find a prime number. After 100 prime numbers are found, the FOR block will stop the execution.

5. What elements are used to represent different programming structures in Blockly?

  • flowcharts
  • colored blocks
  • programming code pieces
  • colored lines and symbols

Explanation: Blockly implements visual programming by assigning different programming structures to colored blocks. These blocks also contain slots and spaces to allow programmers to enter values required by the structure. Programming structures can be connected by dragging and attaching the appropriate blocks.

6. True or False?
Programmers only work on desktop applications.

  • true
  • false

Explanation: In the past, many programmers worked on desktop applications. The Internet and the IoT, however, have opened up many interesting new areas of work for programmers.

7. Which Python function is used for console output?

  • print
  • return
  • for
  • from

Explanation: The print command is used for console output. The command for is used for repetition logic, from is used for module importing, and return is a function definition.

8. What is a Raspberry Pi?

  • a small, low cost, single-board computer
  • a Python function for conditional logic
  • an object-oriented programming language
  • a cloud-based service for teaching IoT

9. Which statement describes Blockly?

  • It is a compiled language.
  • It is a specific Linux distribution.
  • It is graphic editing software for web design.
  • It is a JavaScript based library for implementing visual programming.

Explanation: Blockly is a JavaScript based library for implementing visual programming. By using a number of block types, it allows a user to create a program without entering any lines of code. It is not an example of a compiled language, nor a Linux distribution. Although it provides visual programming features, it is not considered a graphic editing software package.

10. What are two features related to Linux? (Choose two.)

  • open source
  • an application for word processing
  • an example of interpreted language
  • a code base managed by one organization
  • support by a community of programmers

Explanation: Linux is an open source operating system and maintained by a community of programmers. There are many distributions (or variations) of Linux and each distribution has its own code base maintained by an organization.

11. Which language is an example of a compiled programming language?

  • Python
  • PHP
  • Javascript
  • C

Explanation: C is a compiled programming language, whereas Python, PHP, and Javascript are all interpreted languages.

12. A system administrator issues the command ps on a server that is running the Linux operating system. What is the purpose of this command?

  • to process a new task
  • to change file permissions
  • to display the contents of the current directory
  • to list the processes currently running in the system

Explanation: The Linux ps command is used to list the currently running processes in the system. If needed, this command can be instructed to display running processes initiated by the current user or other users.

13. Which Linux shell command can be used to search a specific string of characters within a file?

  • cat
  • man
  • pwd
  • grep

Explanation: There are many CLI commands in Linux, including these:

  • grep – used to search for specific strings of characters within a file or other commands outputs
  • pwd – used to display the current directory
  • cat – used to list the contents of a file
  • man – used to display the documentation for a specific command

14. What is needed for a computer program to communicate with another computer program made from a different vendor?

  • API
  • firmware
  • device driver
  • operating system

Explanation: An application programming interface (API) is a set of routines and software tools that facilitate communication between computer programs.

15. What is the benefit of deploying a group of headless Pi IoT devices?

  • Each Pi IoT device is managed remotely on a network.
  • A single monitor can be connected to the group of Pi IoT devices.
  • The Pi IoT devices can connect to each other using Zigbee.
  • The group of Pi IoT devices must be controlled by a single Pi device in the cloud.

Explanation: The term headless is used to describe servers that are only remotely operated. A Pi can be set up to be managed entirely over the network and can be operated without the need for a monitor, keyboard, or mouse.

16. Which Python command is an example of conditional logic?

  • def
  • delay
  • if
  • from

Explanation: The commands if and else are used for conditional logic. The commands for and while are used for repetition logic, and from is for module importing.

17. To answer the question, you do not need the graphic. Why is it common to connect an Arduino board with a single board computer like the Raspberry Pi?
IoT Connecting Things 2.0 - Chapter 3 Quiz Answers 2

  • The Arduino is a full computer and the Raspberry Pi is not.
  • The Raspberry Pi cannot process incoming digital signals.
  • The Arduino has analog pins.
  • The Raspberry Pi does not require software to interact with an Arduino.

Explanation: Analog signals are generated by thermometers, light sensors, and air pressure sensors. A Raspberry Pi does not have analog pins and requires the use of another device to receive this data. An Arduino has analog pins and can then receive analog signals and data by connecting to a Raspberry Pi via USB.

18. What is an advantage of an executable program coded with an interpreted language compared with a compiled language?

  • It runs faster.
  • It stores as binary format.
  • It is easier to maintain and troubleshoot.
  • It does not rely on another program in order to execute.

Explanation: A program coded with an interpreted language stays in human-readable text, which makes it easy to maintain and troubleshoot. However, it relies on another program, called the interpreter, to parse and execute the code. Because it requires interpretation during its execution, it runs slower than the same program coded by a compiled language.

19. What is a method to secure the control plane of an IoT device?

  • the encryption of user data
  • enforcement of authorized access to code
  • restricting access to servers
  • verification of data integrity

Explanation: Securing the control plane of an IoT device can be done by enforcing authorized access to code, removing any hard-coded debug access accounts, and keeping firmware upgraded.

20. Which Linux distribution is used to develop the Raspbian operating system for the Raspberry Pi?

  • Mint
  • Ubuntu
  • Debian
  • Red Hat
  • Slackware

Explanation: Raspbian, the operating system for Raspberry Pi, is a Debian Linux variation.

Notify of

Inline Feedbacks
View all comments
2 years ago

Very nice subject

1 year ago
Reply to  Marvel

thank u Marvel

Would love your thoughts, please comment.x