Busy. Please wait.
or

show password
Forgot Password?

Don't have an account?  Sign up 
or

Username is available taken
show password

why


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.
We do not share your email address with others. It is only used to allow you to reset your password. For details read 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.

Remove Ads
Don't know
Know
remaining cards
Save
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
Retries:
restart all cards




share
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

F452 Computing

1 Program Constructs

TermDefinition
Statement A single instruction within the algorithm (which can be executed), e.g. Input X.
Keyword Word which is already used for a purpose within the language. Reserved word/cannot be used as an identifier.
Identifier Symbolic name given to a variable, constant or subroutine.
Sequence All instructions are executed once in the order in which they appear.
Selection A condition is used to determine whether or not sections of code will be executed. E.g. IF....THEN....(ELSEIF...)ENDIF / SELECT CASE
SELECT (CASE) Value of variable/expression used to decide which of a number of statement blocks is executed. There can be a default option.
Advantages of SELECT over IF All the alternatives depend on the value of one variable. So this makes the code clearer and easier to read/write. Allows multiple branches and avoids nested Ifs. Avoids numerous repeats of similar conditions.
Iteration Code is executed repeatedly for a given number of times or until a condition is met.
Count controlled loop (FOR) FOR loop is set up with a fixed number of iterations. Uses loop variable. E.g. FOR Count = 1 TO 10.....NEXT Count.
Condition controlled loops (WHILE / REPEAT UNTIL) WHILE loop runs repeatedly depending on a condition (it repeats while the condition is true. E.g. WHILE Count < 11….. END WHILE. REPEAT UNTIL loop repeats until some condition becomes true. E.g. REPEAT … UNTIL Count > 10.
Parameter A description of an item of data supplied to a subroutine. It is given an actual value/address when the subroutine is called. It is used as a variable within subroutine.
Procedure A named section of code which performs a task. Can be called from parent program and returns control to parent program when complete. Used as a statement in the main program. Can be sent parameters.
Function A named section of code. It is called as part of an expression e.g. Num = LENGTH(Name) which returns a single value when called. The value replaces the function call.
RETURN Return tells the program to exit the function and supplies the value which will be used by the main program.
OUTPUT Output tells the program to display a value on the user interface.
Recursion When a subroutine calls itself with different parameter(s) until a stopping condition is met, (when it ‘unwinds’).
Advantages of iteration Uses only one set of variables so more efficient use of memory and can be faster. Less likely to run out of stack space.
Disadvantages of iteration Algorithm may be more difficult to follow/trace because variables are being reused. Need to be careful to get conditions of loops correct. Humans often express the problem in a recursive way (rather than an iterative way).
Advantages of recursion Can be easier to program or more intuitive with an inherently recursive algorithm.
Disadvantages of recursion Uses many sets of variables (one set per call) therefore less efficient use of memory and often slower and can run out of stack space causing run
Nesting When a construct is written completely contained within another. They are not allowed to overlap.
Created by: Chelsea2760