Docsity

Swift Programming Basics: Errors, Data Types, Functions, and Control Flow UPDATED Study, Exams of Medicine

Toggle sidebar
bg1
Swift Programming Basics: Errors, Data
Types, Functions, and Control Flow
UPDATED Study Guide QUESTIONS
AND CORRECT ANSWERS
- Computer Programming - CORRECT ANSWERS The
process of writing instructions (code) that a computer can understand
and execute to perform tasks.
Swift - CORRECT ANSWERS A programming language
created by Apple used to build apps for iPhone, iPad, Mac, Apple
Watch, and Apple TV. It's known for being fast, safe, and easy to read.
Syntax Error - CORRECT ANSWERS A mistake in the
structure or 'grammar' of the code.
Logical Error - CORRECT ANSWERS The code runs, but it
doesn't do what you expected โ€” a mistake in logic, not in syntax.
print (display) - CORRECT ANSWERS Used to show text or
values in the console.
Comments (Program Documentation) - CORRECT ANSWERS
Notes you write in code to explain what it does โ€” ignored by
the computer.
pf3
pf4

Partial preview of the text

Download Swift Programming Basics: Errors, Data Types, Functions, and Control Flow UPDATED Study and more Exams Medicine in PDF only on Docsity!

Swift Programming Basics: Errors, Data

Types, Functions, and Control Flow

UPDATED Study Guide QUESTIONS

AND CORRECT ANSWERS

  • Computer Programming - CORRECT ANSWERS The process of writing instructions (code) that a computer can understand and execute to perform tasks. Swift - CORRECT ANSWERS A programming language created by Apple used to build apps for iPhone, iPad, Mac, Apple Watch, and Apple TV. It's known for being fast, safe, and easy to read. Syntax Error - CORRECT ANSWERS A mistake in the structure or 'grammar' of the code. Logical Error - CORRECT ANSWERS The code runs, but it doesn't do what you expected โ€” a mistake in logic, not in syntax. print (display) - CORRECT ANSWERS Used to show text or values in the console. Comments (Program Documentation) - CORRECT ANSWERS Notes you write in code to explain what it does โ€” ignored by the computer.

Types - CORRECT ANSWERS Categories that define what kind of data a variable holds (like text, numbers, etc.). String - CORRECT ANSWERS A sequence of characters (text). Double - CORRECT ANSWERS A number that can have decimals. Integer (Int) - CORRECT ANSWERS A whole number (no decimals). Variable - CORRECT ANSWERS A named storage that can change. Constant - CORRECT ANSWERS A named storage that cannot change. Arithmetic Operators - CORRECT ANSWERS Used for basic math: + (add), - (subtract), * (multiply), / (divide) Remainder Operator (MOD or %) - CORRECT ANSWERS Gives the remainder after division. Assignment Operator - CORRECT ANSWERS = assigns a value to a variable.

Arguments - CORRECT ANSWERS Actual values you provide when you call the function. Property - CORRECT ANSWERS A value or variable that belongs to an object. Method - CORRECT ANSWERS A function that belongs to an object. Array - CORRECT ANSWERS A collection of multiple values stored in one variable. For Loop - CORRECT ANSWERS Used to repeat actions. Arrays in Functions - CORRECT ANSWERS You can pass arrays into functions. Initializing an Empty Array - CORRECT ANSWERS Creating an array with no elements yet.