{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

3 - Logic and Languages Flashcards

(37 cards)

1
Q

What are the Binary situations?

A

0 - False
1 - True

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

What are Truthtables?

A

Shows output from all possible combinations of inputs from a boolean expression.

AND - both 11
OR - either 01 or 10
NOT - 0=1 1=0

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

What are data validation routines?

A

Ensure data entered is the right type. Ensure data is reasonable and conforms to set rules

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

What are the 5 types of Validation check and explain each one

A

Range - within a sensible/allowed range
Type - right type
Length - not too long or short
Presence - data has been entered
Format - checks for correct format e.g. email/password

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

What is verification?

A

Double checks data has been type in correctly

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

What is Defensive design?

A

Considerations when designing a program to be secure and robust.

Anticipating misuse
Input Sanitisation
Validation
Verification
Authentication
Maintanable code

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

What are Authentication routines?

A

Make sure person is who they say they are

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

What are password routines?

A

Commonly ask for usernames and password. if user ID not found, error message displayed.

User given few attempts to correctly enter password. Anticipating misuse - hackers may try dozens of likely passwords.

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

What are maintainable programs?

A

Maintained to improve code, fix bugs, or add new features to the program. Can be carried out by multiple programmers.

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

How should programs be written to be more maintanable?

A

Subprograms (Functions and Procedures)
Appropriate naming conventions
Indentation
Commenting

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

Why should subprograms be used?

A

Well written ones take inputs through parameters and return a value if necessary.
Written so they can be reused multiple times in a program.

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

Why is indentation used?

A

Easily see which lines are part of different structures

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

Why is commenting used?

A

Helps you understand code when you return to it and helps other programmers understand your code.

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

What are the two types of errors?

A

Syntaxc errors - Code written does not conform to rules of the language. ( Compiler does not know how to translate the program into machine code and therefore syntax error)

Logic error - Program will run but not as intended

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

What do we test for when testing for logic errors?

A

Normal data
Boundary data
Invalid data
Erroneous data

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

How can we find logic errors

A

Using tracetables

17
Q

What are tracetables?

A

Useful for determining algorithm’s purpose, finding ouput and finding errors.

18
Q

What are the two types of testing and explain them?

A

Iterative testing - tests modulus and parts of program as it is developed. Programme rtest code with knowledge of how it works.

Final (terminal) testing - tests whole program et end of production. As the whole program is being tested, they won’t necessarily know how it works.

19
Q

What is Machine code?

A

Binary
Each instruction does one very small task
Writing programs is difficult and time consuming.

20
Q

What is Assembly language and give examples?

A

Allows programmer to create programs more easily than writing machine code. Processor specific and has to be translate to machine code before execution. Low level language.
e.g.
LDA - load
ADD - add
STO - store

21
Q

What are low level languages and what are their advantages?

A

Corresponds directly to machine code instruction.

Run quickly
Use less RAM
Statements can be used to control and manipulate specific hardware components.

22
Q

What are high level languages and how do they work?

A

Look like english and are easier to learn and understand. Have data structures + live arrays and records.
Translation is done by a compiler or interpreter.
E.g.
Python can be run on different types of processors. Different compilers or interpreters used for each type of processer to translate source code (programmer) into machine code for that processor

23
Q

What are the advantages of High level languages?

A

Easier to learn
Faster writing of programs
Easier to understand and debug

24
Q

What are translators and what do they do?

A

Convert high level language into machine code

Compilers
Interpreters

25
What is source code?
Written by programmer
26
What is object code?
Produced by compiler
27
How do compilers work?
Whole of source code converted by compiler into machine / object code. Object code can be saved to a storage drive and run whenever required.
28
How do interpreters work?
Translate each line of code and executes it immediately. If it reaches a line with a syntax error, error message is displayed and it stops. Interpreted code is more portable as it can be run on any computer with an interpreter
29
What are the features of a compiler?
Translates whole program into object code. Executes faster as it is in machine code already. No need for compiler to be present when object code is run Customers who bought commericial software can not see code or adapt it when bought.
30
What are the features of an interpreter?
Translates a line at a time More time to execute as each instruction translated before execution Interpeter must be installed to run program Csutomers can see source doe so could adapt it so see how it works.
31
What is bytecode?
Interpreted on many different processors using an interpreter. Java intermediate phase
32
What is an IDE and what 5 features does it include?
Integrated Development Environment - number of tools and features that help programmers whilst programming E.g. Line numbering Syntax highlighting Error diagnostics Debugging Runtime environment
33
What is line numbering?
Clearly see each new line of code. Line number stated when error found. In some IDE's, part of the program that the programmer doesn't need to see can be folded.
34
What is Syntax highlighting?
Colour of text changes to show different parts of a program. Examples Boolean - dark blue Type conversions - blue String - brown Operators, Variables and Function names - black
35
What are error diagnostics?
Help programmers find mistakes Errors identified along with line nymber Code may be highlighted or underlined to show error
36
What is debugging?
Breakpoints set by programmer so IDE stops program mid-way through running Watch variables change as program runs and see each step
37
What is a runtime environment?
Allows programmer to test program while it is running. During crashes, runtime environment can see what happened and give useful info to programmer. Libraries that come with programming langguage are available for programmer to use.