返回卡包市场

Algorithms & Programs

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 24内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (24 张)

#1
正面 (问题)

What is an algorithm

背面 (解答)

A set of rules to solve a specific problem

#2
正面 (问题)

What are the 3 most common methods for describing an algorithm

背面 (解答)

Pseudocode Structured English Flow Chart

#3
正面 (问题)

What are 3 good programming practices to follow do that your program can be edited more easily in the future

背面 (解答)

Self documenting identifiers - suitable names for identifiers Annotation - describe what the code is doing Program layout - looks tidy and easy to differentiate different parts

#4
正面 (问题)

What are parameters

背面 (解答)

Sets of conditions

#5
正面 (问题)

Define a variable

背面 (解答)

A variable is a store of data

#6
正面 (问题)

What is a constant

背面 (解答)

A constant is a variable which value doesn’t change during the runtime of a program

#7
正面 (问题)

What is the lifetime of a variable

背面 (解答)

The lifetime of a variable is the duration of time for which the variable holds the value during the execution of a program

#8
正面 (问题)

What is the scope of a variable

背面 (解答)

The scope of a variable describes the parts of the program in which the variable can be accessed. E.g. a global variable would have a scope of the entire program

#9
正面 (问题)

What is a subroutine

背面 (解答)

Performs a specific task packaged as a unit

#10
正面 (问题)

What are the advantages of subroutines

背面 (解答)

Makes the program easier to understand by splitting into smaller chunks By splitting the program into separate subroutines, it is easier to test each procedure in isolation before being used with the rest of the program Allows team-working as different members of a team can be allocated different procedures to write Procedures can be reused in future programs. It is also possible to compile procedures and put them into subroutine libraries so that they can be called from other programs.

#11
正面 (问题)

What are the two types of subroutine?

背面 (解答)

Procedures or functions

#12
正面 (问题)

What is the difference between a function and a procedure?

背面 (解答)

A function produces am output/returns a value whereas a procedure doesn’t

#13
正面 (问题)

What is a function?

背面 (解答)

A section of code that, when programming, can be called by another part of the program with the purpose of returning one single value

#14
正面 (问题)

What is a procedure?

背面 (解答)

A section of code which performs a specific task when called from elsewhere in the program

#15
正面 (问题)

What is a parameter?

背面 (解答)

Values that can be sent to a procedure and/or received from a procedure

#16
正面 (问题)

What are the two types of parameters

背面 (解答)

Value or reference

#17
正面 (问题)

What is passing by value?

背面 (解答)

Parameters that are used to pass information into a procedure but which do not receive information back E.g. this works by sending a copy of the parameter to the procedure so any changes made are to the copy and therefore so not affect the original value

#18
正面 (问题)

What is passing by reference?

背面 (解答)

Parameters that need to be able to pass information back. E.g. this works by sending a copy of the memory address is passed into the procedure and therefore any changes made are to the memory location of the variable sent to the procedure.

#19
正面 (问题)

Subroutines as a black box, what does this mean?

背面 (解答)

Separate from the rest of the program, hides the complexity within the subroutines Ignored by programmers who are developing it ofc A programmer only need to know the parameters (inputs and outputs) to the procedure and doesn’t need to know how the procedure works (I.e. what goes on inside) Therefore code inside the procedure can be modified/improved without other parts of the program bring affected as long as it continues to use the same parameters This is also why global variables are best avoided where possible as these are ways in which the procedure can interact with the rest of the program without using parameters

#20
正面 (问题)

What are modules

背面 (解答)

Modules are collections of subroutines (procedures & functions)

#21
正面 (问题)

Modules should he loosely coupled and highly cohesive, what does this mean?

背面 (解答)

Loosely coupled - independent or almost independent (they can function completely without the presence of the other) (the module is not much dependent on other modules) Cohesion - the degree at which different parts of the module related to eachother E.g. a module used to calculate tax returns should just contain subroutines used in different steps od the tax return process, and not routines used for other parts of the system (the parts of a module fit together to a high degree)

#22
正面 (问题)

What is validation?

背面 (解答)

Checking how appropriate the data being entered is

#23
正面 (问题)

What are the 6 types of validation

背面 (解答)

Range check - makes sure data is between a min and max val Presence check - ensures that a particular data item hasn’t been omitted Length check - could be min or max length of characters entered Type check - ensures that the correct type of data has been entered e.g. quantity field only contains digits Format check - correct format e.g. dd/mm/yy Lookup check - checks the data entered is present in a list of possibilities e.g. confirms a postcode exists

#24
正面 (问题)

What is verification?

背面 (解答)

Checking to see if the data entered is consistent E.g. asking for you to enter password twice when changing it to avoid locking yourself out of your own account