0
0
Intro to Computingfundamentals~10 mins

Embedded systems in everyday devices in Intro to Computing - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an embedded system device name.

Intro to Computing
device_name = "[1]"
Drag options to blanks, or click blank then click option'
ATablet
BLaptop
CDesktop
DSmartphone
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a device that is not typically an embedded system like Desktop.
2fill in blank
medium

Complete the code to check if a device is an embedded system.

Intro to Computing
if device_type == "[1]":
    print("This is an embedded system.")
Drag options to blanks, or click blank then click option'
ALaptop
BMicrowave
CServer
DComputer
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing general-purpose computers instead of embedded devices.
3fill in blank
hard

Fix the error in the code that simulates an embedded system sensor reading.

Intro to Computing
import random
sensor_value = [1](10, 100)
print(f"Sensor reading: {sensor_value}")
Drag options to blanks, or click blank then click option'
Arandom.randint
Brandint
Crandom.range
Drandom.random
Attempts:
3 left
💡 Hint
Common Mistakes
Using randint without the random module prefix.
Using random.range which does not exist.
4fill in blank
hard

Fill both blanks to create a dictionary of embedded devices and their functions.

Intro to Computing
embedded_devices = {"[1]": "controls temperature", "[2]": "manages lighting"}
Drag options to blanks, or click blank then click option'
AThermostat
BSmartphone
CSmart Bulb
DLaptop
Attempts:
3 left
💡 Hint
Common Mistakes
Using general-purpose devices like Laptop or Smartphone which are not specific embedded devices here.
5fill in blank
hard

Fill all three blanks to create a list comprehension of embedded system devices with their power status.

Intro to Computing
device_status = [{"device": [1], "power": [2] for [3] in devices]
Drag options to blanks, or click blank then click option'
A"Smartwatch"
B"On"
Cdevice
D"Off"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes for strings, or using incorrect variable names for iteration.