Input And Output (Ch6) (M2) Flashcards

1
Q

If you input something incorrectly, what will happen to the output?

A

If you input something wrong, it will be processed and be outputted as something wrong.
This is known as Garbage In, Garbage Out (GIGO)
Simply, if you input wrong information, you will get wrong information back.

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

What is validation? What doesn’t it check?

A

Validation is an automatic computer check to ensure that the data entered is sensible and reasonable. It doesn’t check the accuracy of data.

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

Give three types of validation checks

A

Types of validation checks:

Prescence check, Range check, Length check, Format check, Spell check

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

What does a range check check for?

A

A range check checks that the input falls within a specified range.
This is usually applied to numbers and dates, but can apply to characters.
For example, when making a payment to someone, the amount to be entered might be set to be greater than zero and not greater than the funds available.

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

What does a length check check for?

A

Checks that the input is not too long or short.
For example, a surname will require at least one letter, but is unlikely to require more than 40.

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

What does a prescence check check for?

A

A prescence check checks that a data value has been entered. For example, entering a quantity when placing an order.

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

What does a format check check for?

A

A format check checks that the data is in the correct format, such as entering a date in the format DD/MM/YYYY.

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

What does a type check check for?

A

A type check checks that the data must be of a specified data type, such as an integer when specifying a quantity.

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

What is the purpose of data sanitisation?

A

The purpose of data sanitisation is to hide or protect data so it can’t be seen or disclosed.

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

Give two examples of data sanitisation

A

Two examples of data sanitisation: masking and input sanitisation.

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

What does masking do?

A

Masking hides visible data by replacing it with something else

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

What does input sanitisation do?

A

Input sanitisation checks that data is entered and removes anything that might be potentially dangerous

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

What is 2 factor authentication?

A

Two factor authentication is where the user enters in their username and password. An authentication code is then sent to the user’s mobile device. The user then has to enter their authentication code to log into the application.

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

Give an example of a service/company that uses 2 factor authentication

A

Google drive, amazon, apple all use 2 factor authentication

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

What is a lookup table?

A

A lookup table is a table of acceptable entries

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

What is authentication?

A

Authentication is a technique used to prove online identity
It is a process where a user is confirming that they are who they say they are on a computer system.

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

A user provides a login and password which is stored in a system. What is the problem with this?

A

This does not prove the actual person is entering this data, as might be the case with identity theft.

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

What does single factor authentication include?

A

Single factor authentication includes inputting:
Username and password

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

What does two factor authentication include?

A

Two factor authentication includes inputting:
Username and password
Password pin/phone call/text message

20
Q

Why is two factor authentication useful?

A

Two factor authentication makes it harder for hackers to gain access to your account

21
Q

Give a common example of authentication

A

Passwords are a common example of authentication

22
Q

Give one way you can increase the security of a password-based authentication system

A

Here are some common ways to increase the security of a password-based authentication system:

Force users to use strong passwords and have them change passwords regularly.
Limit the number of failed authentication attempts before access to an account is lost.
Ask for a random selection of characters from the password on each authentication.

23
Q

Why can too much authentication be a problem?

A

Too much authentication can affect a program’s functionality and put people off using it

24
Q

Give 4 features of a robust program

A

Features of a Robust Program:

Anticipating misuse, input sanitisation, validation, verification, authentication, maintainable code

25
Q

What is anticipating misuse?

A

Anticipating misuse is planning ahead to take steps against potential misuse

26
Q

Give two types of authentication

A

Types of Authentication:

SMS/Email Codes
Voice
Passwords
Fingerprint
Face Verification

27
Q

What is reCAPTCHA? What does it do?

A

It helps to protect websites from spam and abuse.
It is a type of CAPTCHA which is a test to tell humans and bots apart.

28
Q

What is a robust program?

A

A robust program is a program that can handle errors and other unexpected conditions in some reasonable way

29
Q

What does a well-maintained program allow for?

A

A well-maintained program makes it easy for other programmers to understand what the code does.
They should also be able to change parts of the source code without the risks of causing problems elsewhere in the code.

30
Q

Give two ways you can make a program maintainable

A

Examples of making a program maintainable include:

Using subprograms to reuse code and make them easier to test. This is called modularisation
Using indentation to improve readability and clearly show each ‘block’ of code
Appropriate variable names, using a naming convention, ensure the purpose of a variable is immediately understood
Comments enable a programmer to understand the purpose of each line of code. Crucial when working in a team.
Using constants is another method of improving maintainability. This keeps the program consistent, which makes it easier to read and debug a program.

31
Q

What is modularisation?

A

Modularisation is using subprograms to reuse code and make them easier to test

32
Q

Give a method used to make a program maintainable

A

Methods to make programs maintainable:
Sensible variable names, comments, indentation, appropriate variable names, using constants, using subprograms

33
Q

What do structure diagrams show?

A

Structure (or modular) diagrams show the smaller tasks of a larger program.

34
Q

Describe a structure diagram and how it is split up

A

Structure diagrams are made by decomposing the program that you want to write into manageable modules.
Each of those modules is then decomposed even further into smaller modules and eventually into modules that perform individual tasks.

35
Q

Give three advantages of using structure diagrams

A

Advantages of using structure diagrams:

Coding is easier because you’re only writing code to carry out very simple tasks.
Lots of programmers can work on one program as each module can be written independently.
It’s easier to test your program as each module can be tested individually.
Individual sub programs and modules can be fixed and updated without affecting the rest of the program.
You will be able to reuse the sub programs and modules in programs you write in the future.

36
Q

Data can be read from a file, using what mode?

A

Data can be read from a file using read mode

37
Q

What does using read mode do?

A

Using read mode protects the data from being accidently changed, preventing data from being written to a file

38
Q

In the read and write modes, a file is accessed using what?

A

The file is accessed using a file handle in both the Read and Write modes

39
Q

What is read mode?

A

Read mode is where you can access the file however you cannot make any changes

40
Q

What is write mode used for?

A

Write mode is used to write text to a file (Used to change the data contents of a file)

41
Q

What is write mode?

A

Write mode is where you can access the file and also make changes

42
Q

What is file handling?

A

File handling is the process of storing and manipulating data in a file using a program

43
Q

What are the three steps to writing data to a file?

A

Steps:
Open the file using the file path
Write data to the file
Close the file

44
Q

What can happen to an unclosed file?

A

An unclosed file may become corrupted or data may be lost

45
Q

Write an algorithm in pseudocode to read in the message ‘This is the text stored in a file!’ from a text file called ‘message.txt’

A

FileName = OpenRead(“message.txt”)
FileName.ReadLine()
FileName.Close()