Unit 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a data type?

A

The kind of values that can be used in a data item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is an arithmetic operator?

A

a symbol that will perform an operation on numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Examples of data types

A
  • Integer
  • Float/Real
  • Character
  • String
  • Boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Examples of arithmetic operators

A

+, -, *, /, ^, MOD, DIV

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a range check?

A

ensuring that a number or date is within a sensible/allowed range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a type check?

A

ensuring that data is of the right type, such as integer, letter or text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Length check

A

Text entered is not too long or too short - for example, a password is between 8 and 15 characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Presence check

A

Checks that data has been entered i.e. the field has not been left blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Format check

A

Checks that the format of, for example, a postcode or email address is correct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Validation vs Verification

A
  • Validation can only check that the data entered is reasonable
  • Verification is used to double-check that the data has been typed in correctly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Double-entry verification

A
  • A user setting up a new password may be asked to type it in twice
  • If the two passwords don’t match, they will be asked to enter the password again
  • This is known as double-entry verification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Authentication routines and an example

A
  • Are used to make sure a person is who they claim to be
  • Commonly, you are asked to enter a user ID and a password
  • Once you have the entered user ID, the website looks up your password in the database
  • If the user ID cannot be found, an error message is displayed
  • You usually get three attempts to get your password and then you are locked out
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Syntax errors

A
  • A syntax error is one where the code written doesn’t conform to the rules of the language
  • The compiler doesn’t know how to translate the program into machine code so will give the programmer a syntax error
  • The program cannot be run until all syntax errors are fixed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Examples of syntax errors

A
  • missing a symbol
  • misspelling a word
  • mixing up capitalisation in variable names
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Logic errors

A

Logic errors are from a misunderstanding of what the code is doing - the code will still run, but have unexpected outcomes
- using the wrong Boolean statement (e.g. OR instead of AND)
- using the wrong data type
- writing statements in the wrong sequence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Trace tables

A
  • Used for tracking the outputs of a program, and the values of each variable used in a program
  • They are useful for for finding logical errors
17
Q

What is an array?

A
  • An array is a data structure that allows you to hold many items of data which is referenced by one identifier
  • All items of data in the array must be of the same data type
  • Has a fixed length
18
Q

What is a record?

A

A data structure consisting of a number of fields which can all be of different types

19
Q

What is a subroutine?

A

A small subsection of the whole program that performs a specific, well-defined task

20
Q

Parameter

A

A piece of data that is passed into a subroutine in order for that subroutine to do its job

21
Q

Calling

A

A process where an instruction in one part of the code tells another named part of the code to run

22
Q

Modularisation

A

The process of breaking a program into smaller parts called modules. A subroutine is a type of module.

23
Q

Return

A

A command in which a subroutine passes a piece of data back to the line of code from which it was called

24
Q

Authentication

A

The software process of ensuring that the person accessing a system is the person who is supposed to access that system. The following might be used:
- Usernames and passwords
- Memorable information - prompting for something only the real user should know, such as favourite place or the name of a first pet
- Checking that the user is using their usual computer