Bird
Raised Fist0
Intro to Computingfundamentals~10 mins

Wearable technology in Intro to Computing - Interactive Code Practice

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

Complete the code to define a wearable device's main function.

Intro to Computing
def wearable_device():
    return [1]
Drag options to blanks, or click blank then click option'
A"Smartwatch"
BSmartwatch
CTrue
D12345
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the string.
Returning a number instead of a string.
2fill in blank
medium

Complete the code to check if a wearable device is active.

Intro to Computing
is_active = [1]
if is_active:
    print("Device is on")
Drag options to blanks, or click blank then click option'
Afalse
B"yes"
C1
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string "yes" instead of the boolean True.
Using lowercase true or false which are not valid in Python.
3fill in blank
hard

Fix the error in the code to correctly calculate battery percentage.

Intro to Computing
battery_level = 80
max_battery = 100
percentage = battery_level [1] max_battery * 100
print(percentage)
Drag options to blanks, or click blank then click option'
A/
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or subtraction instead of division.
Multiplying battery_level by max_battery directly.
4fill in blank
hard

Fill both blanks to create a dictionary of wearable devices and their battery levels.

Intro to Computing
devices = {"watch": [1], "earbuds": [2]
Drag options to blanks, or click blank then click option'
A85
B"active"
C90
D"off"
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings like "active" instead of numbers.
Mixing numbers and strings incorrectly.
5fill in blank
hard

Fill both blanks to filter devices with battery above 50%.

Intro to Computing
filtered = {k: v for k, v in devices.items() if v [1] [2]
print(filtered)

# Expected output: {'watch': 85, 'earbuds': 90}
Drag options to blanks, or click blank then click option'
A>
B50
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than or equal instead of greater than.
Using equality instead of comparison.

Practice

(1/5)
1. What is wearable technology primarily used for?
easy
A. Large desktop computers used for gaming
B. Small computers worn on the body to help with tasks and health tracking
C. Software programs installed on smartphones
D. Traditional wristwatches that only tell time

Solution

  1. Step 1: Understand the definition of wearable technology

    Wearable technology refers to small computers worn on the body.
  2. Step 2: Identify the main uses

    They help track health, show notifications, and make tasks easier.
  3. Final Answer:

    Small computers worn on the body to help with tasks and health tracking -> Option B
  4. Quick Check:

    Wearable technology = Small body-worn computers [OK]
Hint: Wearables are small computers worn on the body [OK]
Common Mistakes:
  • Confusing wearable tech with large desktop computers
  • Thinking wearable tech is just software
  • Assuming all watches are wearable tech
2. Which of the following is the correct example of wearable technology?
easy
A. Tablet
B. Desktop computer
C. Smartwatch
D. Printer

Solution

  1. Step 1: Recall examples of wearable technology

    Wearable technology includes devices like smartwatches, fitness bands, and smart glasses.
  2. Step 2: Match options to wearable devices

    Only the smartwatch is worn on the body and fits the wearable tech definition.
  3. Final Answer:

    Smartwatch -> Option C
  4. Quick Check:

    Wearable example = Smartwatch [OK]
Hint: Wearables are devices worn on the body like smartwatches [OK]
Common Mistakes:
  • Choosing devices not worn on the body
  • Confusing tablets or printers as wearable
  • Ignoring the 'worn on body' part
3. Consider this simple flowchart for a fitness band: Start -> Measure Heart Rate -> Is Heart Rate > 100? -> Yes -> Alert User -> End What is the output if the heart rate measured is 85?
medium
A. No alert, process ends
B. Error message
C. Alert User
D. Measure Heart Rate again

Solution

  1. Step 1: Follow the flowchart steps with heart rate 85

    The heart rate is measured as 85, which is not greater than 100.
  2. Step 2: Check condition and output

    Since 85 <= 100, the 'Yes' branch is not taken, so no alert is sent and the process ends.
  3. Final Answer:

    No alert, process ends -> Option A
  4. Quick Check:

    Heart rate 85 ≤ 100 -> No alert [OK]
Hint: If heart rate ≤ 100, no alert is triggered [OK]
Common Mistakes:
  • Assuming alert triggers for all heart rates
  • Confusing the condition > 100
  • Thinking process repeats automatically
4. A smartwatch program is supposed to display a notification when steps exceed 10,000. The code snippet is:
if steps > 10000
  display('Goal reached!')
What is the error in this code?
medium
A. Incorrect comparison operator
B. Steps variable is not defined
C. Wrong function name for display
D. Missing colon after if condition

Solution

  1. Step 1: Check Python syntax for if statements

    Python requires a colon ':' at the end of the if condition line.
  2. Step 2: Identify missing colon in the code

    The code has 'if steps > 10000' without a colon, causing a syntax error.
  3. Final Answer:

    Missing colon after if condition -> Option D
  4. Quick Check:

    Python if needs ':' after condition [OK]
Hint: Always put ':' after if conditions in Python [OK]
Common Mistakes:
  • Forgetting the colon after if
  • Assuming display() is invalid without checking
  • Thinking comparison operator is wrong
5. A fitness band tracks steps and heart rate. It should alert the user if steps are below 5000 and heart rate is above 120. Which logic correctly implements this in Python? A) if steps < 5000 and heart_rate > 120: alert('Check your health!') B) if steps > 5000 or heart_rate < 120: alert('Check your health!') C) if steps < 5000 or heart_rate > 120: alert('Check your health!') D) if steps > 5000 and heart_rate < 120: alert('Check your health!')
hard
A. Alert if steps below 5000 AND heart rate above 120
B. Alert if steps above 5000 OR heart rate below 120
C. Alert if steps below 5000 OR heart rate above 120
D. Alert if steps above 5000 AND heart rate below 120

Solution

  1. Step 1: Understand the alert condition

    The alert triggers only when both steps are below 5000 AND heart rate is above 120.
  2. Step 2: Match the condition with Python logic

    Alert if steps below 5000 AND heart rate above 120 uses 'and' with steps < 5000 and heart_rate > 120, which matches the requirement exactly.
  3. Final Answer:

    Alert if steps below 5000 AND heart rate above 120 -> Option A
  4. Quick Check:

    Both conditions must be true -> use 'and' [OK]
Hint: Use 'and' to require both conditions true [OK]
Common Mistakes:
  • Using 'or' instead of 'and' for both conditions
  • Reversing comparison operators
  • Confusing steps and heart rate conditions
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard