0Still learning
Know0
Define event-driven programming.
Event-driven programming is an approach where the flow of the program is determined by events rather than a fixed sequence of statements.

Join for free to unlock a full flashcard set, track what you know,
and turn revision into real progress.
Define event.
An event is an action that occurs as a result of user interaction or another trigger.
Define event handler.
An event handler is a section of code (a procedure) that is executed when a specific event is detected.
Was this flashcard helpful?
Define event-driven programming.
Event-driven programming is an approach where the flow of the program is determined by events rather than a fixed sequence of statements.
Define event.
An event is an action that occurs as a result of user interaction or another trigger.
Define event handler.
An event handler is a section of code (a procedure) that is executed when a specific event is detected.
Name three types of event.
Types of event include a key press, mouse click, mouse movement, screen tap, timer, and program start.
True or False?
A program can only contain one event handler.
False.
Multiple event handlers can exist within a single program, each responding to a different event.
Event-driven programs spend most of their execution time _______ for events to occur rather than actively running code.
Event-driven programs spend most of their execution time waiting for events to occur rather than actively running code.
True or False?
Events are the only way input can enter a program.
False.
Events are one way input enters a program, but programs can receive input from many other sources too.
Define input.
Input is any data provided to a program from an external source.
Name four forms that input can take.
Input can be tactile (touch), audio, visual, or text.
Name four sources of input.
Sources of input include user input, file input, sensor input, and network input.
What does the input-output relationship describe?
The input-output relationship describes how specific inputs are transformed by the program's processing to produce specific outputs.
A program's output depends on its input or on what else?
A program's output depends on its input or its prior state.
Define output.
Output is the data or information that a program produces as a result of its processing.
Name four forms that output can take.
Output can be text, visual, audio, or tactile.
A phone vibrates when a message arrives. What form of output is this?
A phone vibration is tactile output.
Name three things the output of a program at any given moment depends on.
The output depends on:
The input it has received
The current program state
The logic and sequence of statements in the program
Define program state.
Program state is the values stored in all variables at a given point in execution.
True or False?
A line of code always produces the same output every time it runs.
False.
Program state changes as the program runs, so the same line of code can produce different output at different times.
Define dependency in a program.
A dependency exists when one part of a program's output relies on another part of the program completing first.
Programs often produce ____________ results that feed into later calculations or displays.
Programs often produce intermediate results that feed into later calculations or displays.
Why is understanding dependencies important?
Understanding dependencies is important for predicting what a program will output and in what order.
How can a program produce incorrect output even when each individual statement appears to be right?
A program can produce incorrect output if statements are reordered or a variable is updated at the wrong point.
What value is displayed when this code segment runs?
a ← 2
b ← a * 4
a ← 7
DISPLAY(b)The code segment displays 8, because b is assigned 2 * 4 while a is 2. Changing a afterward does not change the value already stored in b.
Define development methodology.
A development methodology is an approach that guides how a program is built from start to finish.
Name three development methodologies.
Three development methodologies are ordered and intentional, iterative, and exploratory.
How are stages completed in ordered and intentional development?
In ordered and intentional development, stages are completed in a fixed sequence, and each phase must finish before the next begins.
When is exploratory development used?
Exploratory development is used when the problem is not well understood at the start.
Name two factors that affect the choice of development methodology.
The choice depends on how clearly the problem is defined and how likely the requirements are to change.
True or False?
Iterative development is used in most real-world projects.
True.
User needs and requirements frequently change during development, so most real-world projects use iterative development.
What is the risk of ordered and intentional development if requirements are misunderstood early?
If requirements are misunderstood early, there is no opportunity to correct them until the end, which can be costly.
Name one drawback of exploratory development.
Without clear goals, exploratory development can be difficult to manage and may produce inconsistent results.
Define iterative development.
Iterative development is building a program through repeated cycles of designing, implementing, testing, and refining.
Define incremental development.
Incremental development is adding new features or functionality one step at a time, rather than building the entire program at once.
_______ design supports incremental development by breaking the program into independent components that can be built and tested separately.
Modular design supports incremental development by breaking the program into independent components that can be built and tested separately.
How does iterative development help when requirements change?
Iterative development lets the program adapt to changing requirements or a new understanding of the problem.
Define program design.
Program design is the process of planning the structure and behavior of a program before writing code.
What does investigation determine during program design?
Investigation determines the program's requirements: what the program must do and who it is for.
Name four investigation methods used to understand user constraints and interests.
Investigation methods include surveys, interviews, direct observations, and user testing.
Which investigation method involves watching users interact with an existing system to identify problems?
Watching users interact with an existing system is direct observation.
True or False?
Interviews collect opinions and preferences from a large group of users.
False.
Surveys collect opinions from a large group. Interviews are in-depth conversations with individual users.
Define program requirements.
Program requirements describe how a program functions and may include a description of the user interactions the program must provide.
What does the design phase outline in a development process?
The design phase outlines how to accomplish a given specification.
A program's _____________ defines the requirements for the program.
A program's specification defines the requirements for the program.
Name three common design activities.
Common design activities include:
Brainstorming
Planning and storyboarding
Organizing the program into modules and functional components
Creating diagrams of the user interface layout
Developing a testing strategy
What is the purpose of brainstorming?
Brainstorming generates a range of ideas before committing to one approach.
What does storyboarding map out?
Storyboarding maps out the program's features and the user's journey through the screens.
True or False?
Dividing a program into modules is a development activity that happens after coding begins.
False.
Organizing a program into modules and functional components is a design activity that happens before coding begins.
What is decided when developing a testing strategy during design?
A testing strategy decides in advance how the program will be tested and what outputs are expected for given inputs.
Define documentation.
Documentation is written information that describes how the code was developed, what a program or section of code does, how it works, and how it should be used.
When is documentation completed?
Documentation is completed throughout development.
How does documentation support a development team?
Documentation helps team members understand each other's code.
How does documentation help with program maintenance?
Documentation helps developers understand the original intent of the code without reading every line in detail.
How does documentation improve correctness?
Documentation improves correctness by making the intended behavior of the code explicit, reducing the risk of misinterpretation.
Define comment.
A comment is the most common form of in-code documentation, written into the program for human readers.
True or False?
Comments are executed by the computer along with the rest of the program.
False.
Comments are ignored by the computer during execution. They are written for human readers.
Name four things that documentation can describe.
Documentation can describe a code segment, an event, a procedure, or a program.
What can be used for documentation if a programming environment does not support comments?
If a programming environment does not support comments, documentation can be provided in external documents or separate readme files.
Outdated comments can be more __________ than no comments at all.
Outdated comments can be more misleading than no comments at all.
Define code attribution.
Code attribution is the practice of acknowledging the original author or origin of code that has been reused or adapted within a program.
Name three sources of reused code that need attribution.
Reused code that needs attribution can come from an open-source library, a tutorial, or a collaborator.
Where is code attribution typically provided?
Attribution is typically provided as a comment within the code, near the section that was reused or adapted.
Name two things a complete attribution should include.
A complete attribution should include:
The name of the original author
The source or location where the code was found
Any license or usage terms, where relevant
True or False?
Code that is freely available online can be used without attribution.
False.
Reused code must always be credited to its original author or source, even if it was freely available online.
Name two reasons why code attribution matters.
Attribution matters because it:
Gives credit to the people whose work made a project possible
Allows others to find the original source and understand its context
Demonstrates integrity and respect for intellectual property
Failing to attribute reused code correctly can constitute __________.
Failing to attribute reused code correctly can constitute plagiarism.
By signing up you agree to our Terms and Privacy Policy