Unit 8 Flashcards

(19 cards)

1
Q

AND gate

A

2 inputs, half an oval and one output

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

OR gate

A

2 inputs, looks like a crescent moon, one output

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

NOT gate

A

1 input, blank triangle and blank dot, one output

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

Function of a truth table

A

shows the output from all possible combinations from a boolean function

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

What is data validaton and the different types with features

A

data validation routines ensure data is entered in the right type (ie: integer)

Range check

a number or date is in a sensible range

Type check

data type is correct

Length check

Data entered isn’t too long or short

Presence check

Data is actually entered in (can’t leave it blank)

Formal check
checks the format (ie: postcode/email) is correct

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

What is verifications

A

A double check to make sure the data is typed in correctly

ie: double entry validation (asks user to enter password twice)

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

What are authenticaton routines used for

A

make sure a person is who they claim to be

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

How does a device anticipate misuse

A

if a password has been entered too many times and it has constantly been wrong it might be a hacker or someone else trying to gain access to the personal info as the normal person would only need around 3 tries

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

Why do programs need to be maintainable and what are the 4 methods of doing so

A

Improve code, fix bugs, or add new features

May be carried out by original or different programmers, and maintainable programs help other programmers understand your code more easily

WAYS TO MAKE PROGRAMS MAINTAINABLE:

Use of sub programs (functions/procedures)

creates reusable code where bugs can easily be fixed

Appropriate naming for variables

Good use of names makes the program easier to read/understand by collaborators

Indentation

Makes the program easier to read as its neater

Comments

Helps people understand what a program is and how does it

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

Whats an IDE and what can it do

A

When you code in a high level language, you use an Integrated Development Environment. It may give you:

Tips on the syntax you’re typing

keywords and text statements in a different colour

automatic indentation

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

What does an IDE provide you with

A

Editor

Allows you to write/correct your program and helps with correcting syntax

Compiler/interpreter

Converts program into machine code

Error diagnostics

Print out syntax errors

Debug facilities:

step through a program line by line to spot logic errors

runtime environment

To create a space to run your program in

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

Difference between logic syntax and runtime errors

A

Logic:

the code runs fine but mistakes in the algorithm you have devised to perform a required task

Syntax:

A syntax error occurs when code written does not follow the rules of the programming language

Runtime error:

Errors that only happen while the code is running

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

What is the purpose of testing and the 3 types of tests you should do

A

A successful test is one which uncovers an error

You will need to test all the different paths in your program so you will make a test with:

Valid data
Invalid data
Boundary data - on the boundary of the valid range

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

Whats a good way of finding logic errors and whats it also useful for

A

TRACE TABLE:

determining purpose of an algorithm

finding output of an algorithm

finding errors in an algorithm

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

What is iterative and final testing used for

A

Iterative:

Carried out using test plan and trace tables until all bugs are removed and program produces expected answers

Final:

carried out when program is completely finished and all parts have been separately tested

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

High level language

A

Majority of code is written in this (ie: python)

One instruction represents many instructions of machine code

same code works on different machines/processors

Code is easy to read/write

Dont need to know about processor/memory structure

Must be translated/interpreted before it can be executed

Slower/less memory efficient

17
Q

Low level language

A

Low Level Language:

Machine Code: 0011 0100…
Assembly language: ADD r4 r3..

One instruction of assembly code cna represent one of machine code

Code usually works for one machine/processor

Code is hard to read/write

Need to know internal structure of CPU and how to manage memory

Machine code can be executed directly without being translated

Faster and more memory efficient

18
Q

Compuler vs interpreter

A

Compiler

Translate all source code into machine code, creating an executable file

Needed once for initial translation

Returns a list of errors for the whole program where compiling is complete

Compiling can take a long time , but the program runs quickly once compiled

Interpreter

Translates and runs each line/instruction at a time using its own machine code subroutines

Used every time code is run
Stops and returns first error found

Programs run more slowly

19
Q

What is an assembler and one thing about assembly code making it easier to translate

A

A program which translates assembly code into machine code (assembly code is assembled)

there is generally a one to one correspondence between each assembly code statement and their machine code correspondent