Color theme
0 day streak0 XPP1
SwiftQuiz mode
MISSION 1 OF 3

Catalog a ceramic bowl

0 XP earned
Swift track: IntermediateMission: IntermediateStructsValue typesMutability
Before you start this intermediate track

Functions and collections. Work with structs, mutable bindings, and optionals.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 6 challenges
KNOWLEDGE CHECK

Predict the result.

What catalog entry is printed?

Quest.swift
struct Bowl {    var glaze: String    var fired: Bool}var piece = Bowl(glaze: "blue", fired: false)piece.fired = trueprint("\(piece.glaze): \(piece.fired)")

Run each mission independently as a Swift 5.9 or later script or playground. Top-level statements execute directly; these examples need only the Swift standard library and no Apple UI frameworks.

Review the lesson

A pottery catalog keeps related details in a struct. Its stored properties describe one bowl. Swift structs are value types: a constant instance cannot have its properties changed, even if the properties use var. Declaring both the instance and its fired property with var allows the catalog to record the kiln result.

Choose your answer+25 XP on first completion