Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

2.2.1

QuestionAnswer
Programming Constructs it is possible to nest constructs - Sequence - Iteration - Branching
Sequence Computers will execute statements one after another, in the order they are presented Default construct
Iteration Computers repeat a section of code (a loop) - Count(er)-controlled - Condition-controlled
Count(er)-controlled Run a specified number of times - For loop
Condition-controlled Run as long as a boolean expression is true - While loop - Do…until loop
Branching (or selection) Allows a program to change direction depending on an outcome of a condition (Boolean expression) - if/else statements - switch/case statements - Assembly language: - BRA - BRP
Recursion Where a procedure or function calls itself from within its own subroutine To stop infinite recursion + stack overflow, it: -Contain base case -Call itself for any input (not base case) -Base case reachable after a finite number of subroutine calls
Base case stopping condition
Subroutine is called program state (and all local variables) are stored on call stack, along with program line When finished, value is popped Same thing happens in recursion, just several times, running risk of stack overflow
Recursive (compared to iteration) Iterative approaches should be favoured, but sometimes recursion is favourable or necessary. Pros More realistic + easier to code for some problems More elegant + easier to follow Cons More memory is needed Program may crash if stack overflow occurs
Variables Named locations that store data Contents can be changed in execution, unlike constants Have data types + scope ( extent it can be seen within different parts of a program): If a local variable has the same name as a global one, it is prioritised
Local variable Only accessible in the subroutine created in Created inside a subroutine Destroyed when the subroutine exits
Global variable (generally avoided) accessed/used anywhere Typically created at the start of a program, outside of a subroutine Destroyed when the program ends Harder to debug + use more memory
Modularity Concept of breaking down a large problem into smaller chunks, with aim of each module carrying out a single, specific task, making it easier to to test, read, share among a team subroutines shouldn't have effects on wider program (by value)
Procedure perform a set task and takes in 0, 1 or more parameters
Functions same as procedures, and returns a value
Parameter a variable used within a subroutine, whose value is input into subroutine when called
Argument the value passed into the parameter
two passing methods - Passing by value - Passing by reference
Passing by value (python) (favoured) A copy of the value is passed to the subroutine (turns into a local variable) The memory address of the real variable is not sent but the new one is More common, so always assume this method unless told otherwise :byVal code
Passing by reference The parameter is set to point to the same memory location as the variable :byRef code prefix
Modules proceeds or function
IDE (Integrated Development Environment): single piece of software that provides a range of tools and features that help speed up and enhance program development. Features are combined together, and can be used simultaneously.
IDE key features - Code editors - Error diagnostics - Runtime environments - Translators - Auto-documentation - Breakpoints
Code editors text area for programmers to enter code directly into the IDE (often supports additional features as well) - Syntax highlighting - Autocomplete - Automatic indentation
Syntax highlighting colours different parts of the program depending on what it is (e.g. variable, comment, reserved word)
Automatic indentation whitespace is automatically placed before statements inside programming constructs like subroutines or loops
Error diagnostics reports errors (mainly syntax) in the code and where they can be found; often suggests possible fixes
Runtime environments software that supports the execution and running of programs to allow programmers to easily run code during development
Translators a program that converts high-level code into executable machine code
Auto-documentation tracks variables, modules and other comments to produce documentation that aides in program maintenance, debugging and support
Breakpoints allow points to be set within the program where it will be paused when run to allow the programmer to try and detect where and why errors are occurring as the state of the variable are examined
Object-Oriented Techniques Most problems can be solved using OOP best when u can encapsulate + model entities as objects E.g: GUI button (Or GUI in general) Attributes: size, colour, location Methods: clicked, hover, double-clicked When event triggered, alerts other objects
Created by: FlashCardFun!
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards