(Mobile Dev) Flashcards
20 cards from real Swift practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 20 (Mobile Dev) flashcards as text
Pixel Art is a term that describes a type of art that is made up
Answer: Individual pixels in an image
Pixel art is a digital art form characterized by images created and edited at the level of individual pixels. Artists meticulously place each pixel to form shapes, colors, and details, emphasizing the pixel as the fundamental building block of the image. This approach often results in a distinct, blocky, and low-resolution aesthetic, where the individual pixels are clearly visible and intentionally arranged.
Which code should be used to get Byte to move forward?
Answer: moveForward ( )
In Swift Playgrounds, `moveForward()` is the standard function call used to make the character Byte move one step forward. The correct syntax for calling a function involves the function's name followed by a pair of parentheses. While `moveForward()` without a space is more common, `moveForward ( )` is presented as the correct option, indicating the invocation of a function named `moveForward`.
To turn the switch on, what command is used?
Answer: toggleSwitch()
In Swift Playgrounds, the `toggleSwitch()` command is specifically designed to change the state of a switch. If the switch is off, it turns it on; if it's on, it turns it off. This function encapsulates the action of interacting with a switch object in the game environment.
Which of the following is not a part of the game development process?
Answer: Not generating ideas
Generating ideas is a fundamental and crucial first step in the game development process, often referred to as the concept or pre-production phase. Without ideas, there would be no game to design, build, test, or release. Therefore, 'not generating ideas' is explicitly *not* a part of game development.
For Byte to gather a Gem, which of the following codes is correct?
Answer: collectGem ( )
Similar to other commands in Swift Playgrounds, `collectGem()` is the specific function call used for the character Byte to pick up a gem. The correct syntax for invoking a function requires the function name followed by parentheses. `collectGem ( )` correctly represents this function call, allowing Byte to gather the collectible item.
What exactly is coding?
Answer: Telling a computer what to do.
Coding, or programming, is essentially the process of writing a set of instructions that a computer can understand and execute. These instructions, written in a specific programming language, tell the computer precisely what tasks to perform and in what order, enabling it to achieve a desired outcome.
What is a swift playground, exactly?
Answer: powerful programming language created by Apple
Swift is a powerful and intuitive programming language developed by Apple, designed for building apps across all Apple platforms like iOS, macOS, watchOS, and tvOS. While Swift Playgrounds is an app for learning Swift, the core technology it teaches and utilizes is the Swift programming language itself.
Which of the following is an example of a developer's error when programming?
Answer: All of the above
All the listed options—extra semicolons, undeclared variables, and uninitialized variables—are common types of errors developers encounter during programming. These issues can lead to syntax errors, compilation failures, or unexpected program behavior, preventing the code from running correctly. Identifying and fixing them is a key part of debugging.
What is the best way to describe an algorithm?
Answer: A step-by-step series of operations
An algorithm is a precise, step-by-step procedure or a set of well-defined instructions used to solve a specific problem or accomplish a task. It outlines the logical sequence of operations required to achieve a particular outcome, independent of any specific programming language.
What does MVC stand for?
Answer: Model View Controller
MVC stands for Model-View-Controller, which is a widely adopted architectural pattern in software engineering, particularly for user interfaces. It separates an application into three distinct components: the Model (data and business logic), the View (user interface), and the Controller (handles user input and updates the Model and View), promoting modularity and maintainability.
What exactly is a sequence?
Answer: Is the order in which the commands are given
In programming, a sequence refers to the specific order in which commands or instructions are given and executed by the computer. The program follows these commands sequentially, one after another, unless control flow statements alter this default order. The correct sequence is vital for a program to function as intended.
What command is used in Swift Playground to collect the jewels?
Answer: collectGem()
In Swift Playgrounds, the `collectGem()` function is the correct and specific command used for the character Byte to pick up a gem (often referred to as a 'jewel'). This function call executes the action of gathering the collectible item within the game environment. The parentheses are essential for invoking the function.
What exactly is debugging?
Answer: finding and fixing errors
Debugging is the systematic process of identifying, analyzing, and removing errors, commonly known as 'bugs,' from computer programs. It involves running the code, observing its behavior, pinpointing where issues occur, and then modifying the code to correct those issues, ensuring the program functions as intended.
You can give instructions to perform something by writing commands. Which of the command sequences is correctly formatted?
Answer: collectGem() moveForward()
In Swift, function calls are correctly formatted with the function name immediately followed by parentheses, such as `collectGem()` and `moveForward()`. Each command is typically placed on a new line for readability. Option B correctly demonstrates this standard syntax for a sequence of commands.
Longer coding sequences can include
Answer: more bugs.
As coding sequences become longer and more complex, the probability of introducing errors or 'bugs' naturally increases. More lines of code mean more opportunities for logical mistakes, syntax errors, or unforeseen interactions between different parts of the program, making debugging more challenging.
What could be the reason of the problem if the code isn't working as it should?
Answer: bugs
If code isn't working as expected, the problem is almost always due to 'bugs.' Bugs are errors or flaws in a computer program that cause it to produce incorrect or unexpected results, or to behave in unintended ways. Identifying and fixing these bugs is the primary goal of debugging.
On iOS, how do you debug and profile code?
Answer: Set up breakpoints using Xcode
Xcode is Apple's integrated development environment (IDE) and the primary tool for developing iOS applications. It provides robust debugging capabilities, including the ability to set breakpoints, which pause program execution at specific lines of code, allowing developers to inspect variables and step through the code to identify issues.
Why is Swift good for game development?
Answer: B & D
Swift is well-suited for game development because it is both fast and accessible. Its design prioritizes performance, which is crucial for games requiring quick execution and responsiveness. Additionally, Swift's modern syntax, safety features, and strong typing make it relatively accessible for developers, contributing to more efficient development and fewer common programming errors.
In Swift, which of the following is the design pattern?
Answer: Iterator
The Iterator pattern is a behavioral design pattern that provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation. It is a fundamental pattern frequently used in Swift, particularly when working with collections like arrays or dictionaries to traverse their elements.
What FRP stand for?
Answer: Functional reactive programming
FRP stands for Functional Reactive Programming. It is a programming paradigm focused on asynchronous data flow and event handling, often utilized in user interface development and systems that process streams of data over time. Frameworks like Apple's Combine are built upon FRP principles.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy