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
Show Answer/Explanation
Correct Answer: 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.

Show Answer/Explanation
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
Show Answer/Explanation
Correct Answer: FOR 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
Show Answer/Explanation
Correct Answer: colored blocks
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
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: print
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
Show Answer/Explanation
Correct Answer: a small, low cost, single-board computer

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.
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: 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
Show Answer/Explanation
Correct Answer: API
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.
Show Answer/Explanation
Correct Answer: Each Pi IoT device is managed remotely on a network.
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
Show Answer/Explanation
Correct Answer: if
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 1

  • 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.
Show Answer/Explanation
Correct Answer: The Arduino has analog pins.
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.
Show Answer/Explanation
Correct Answer: It is easier to maintain and troubleshoot.
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
Show Answer/Explanation
Correct Answer: enforcement of authorized access to code
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
Show Answer/Explanation
Correct Answer: Debian
Explanation: Raspbian, the operating system for Raspberry Pi, is a Debian Linux variation.

Related Articles

guest
1 Comment
Inline Feedbacks
View all comments
Marvel
Marvel
1 month ago

Very nice subject