App-Development-with-Swift-Certified-User 無料問題集「Apple App Development with Swift Certified User」
You are creating or updating human resource records for your employees. For each identifier, select whether it is a Constant or a Variable Note: You will receive partial credit for each correct answer.


正解:

Explanation:
* age - Variable
* birthDate - Constant
* socialSecurityNumber - Constant
* salary - Variable
* currentDepartment - Variable
This question belongs to Swift Programming Language , specifically the objective on demonstrating when to use constants and variables . In Swift, a constant is declared with let and is used for values that should not change after they are set. A variable is declared with var and is used for values that may change over time.
Birth date is a constant because a person's date of birth does not change. Social security number is also a constant because it is intended to be a fixed identifier for that employee record. By contrast, age is a variable because it changes over time. Salary is a variable because compensation can be adjusted. Current department is also a variable because an employee may transfer to another department.
This matches Swift best practice: use let for fixed data and var for mutable data. So in a human resources record, identifiers that are permanent should be constants, while values that can change during employment should be variables.
You need to create a Watchpoint in Xcode. In which order should you complete the actions? Move all the actions to the answer area and place them in the correct order.


正解:

Explanation:

This question belongs to Xcode Developer Tools , specifically the objective on using debugging techniques including breakpoints, watchpoints, and logging to resolve errors . A watchpoint monitors a variable or memory location during a debugging session, so you first need the program to stop while being debugged.
That is why the correct order begins with setting a breakpoint and then running the code so execution pauses at a useful point. Apple's debugging guidance describes debugging as something done at runtime using the debugger, and LLDB's watchpoint documentation explains that watchpoints are part of the debugger workflow rather than something you set before the program is stopped.
Once execution is paused, you use the debug area to inspect the current variables. After locating the variable you want to monitor, you right-click the variable and select Watch to create the watchpoint. This sequence is consistent with how Xcode and LLDB expose watchpoint functionality during an active debug session.
LLDB also describes watchpoints as objects you create to stop execution when a watched value changes, which only makes sense after the debugger has access to the running program state.
