comp sci test - 23.02.24

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

25 Terms

1
New cards

give 5 advantages of using a structure diagram

  • 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

2
New cards

give four features of maintainable source code and how they help other programmers to maintain your code

  • comments - useful for explaining what the key features of a program are

  • indentation - helps programmers to see the flow of the program and pick out different features

  • variables and parameters - should be named according to what they are, making them easier to keep track of

  • sub programs - makes it easier for programmers to see how different parts of a program work

3
New cards

why is it important for your programs to have a defensive design?

programmers will be able to:

  • anticipate how users might misuse their program and prevent it

  • ensure their code is well-maintained

  • reduce the number of errors in their code through testing

4
New cards

define input validation

checking if data meets certain criteria before passing it into the program

5
New cards

what is authentication and why is it used?

authentication confirms the identity of a user before they are allowed to access certain pieces of data or features of a program, which is used to protect the program and the user

6
New cards

give five types of input validation check and what they do

  • range check - checks if the data is within a specified range

  • presence check - checks the data has actually been entered

  • format check - checks the data has the correct format e.g a date

  • look-up table - checks the data against a table of acceptable values

  • length check - checks the data is the correct length

7
New cards

give three things that can be done to make a password-based authentication system more secure

  • force users to use strong passwords and 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

8
New cards

what is a syntax error?

when the compiler or interpreter doesn’t understand something you’ve typed because it doesn’t follow the rules or grammar of the programming language

9
New cards

what is a logic error?

when the compiler or interpreter is able to run the program, but the program does something unexpected

10
New cards

explain why logic errors are more difficult to diagnose than syntax errors

logic errors can’t be picked up by compilers and interpreters so they have to be found manually

11
New cards

why is testing important?

it helps programmers to identify errors in their program and refine their code to fix it

12
New cards

what is iterative testing?

when the program is tested while it is being developed

13
New cards

what is final testing?

when the program is tested at the end of the development process

14
New cards

what are the four types of test data?

  • normal data - things that a user is likely to input into the program

  • boundary/extreme data - values at the limit of what the program should be able to handle

  • invalid data - inputs with a correct data type that should be rejected by the program

  • erroneous data - inputs with an incorrect data type that should be rejected by the program

15
New cards

what are trace tables used for?

they are used as a simple way of testing that a piece of code is working correctly

16
New cards

what is machine code (with an example)?

machine code is the only language that computers understand e.g binary

17
New cards

what is assembly language (with an example)?

assembly language is halfway between machine code and high-level languages e.g mnemonics/operation code

18
New cards

give six differences between high-level and low-level languages

  • one instruction of high-level language is many instructions of machine code, whereas one instruction of assembly code is one instruction of machine code

  • high-level code will work on many processors, whereas low-level code will usually only work on one type of processor

  • the programmer can easily store high-level code without knowing the CPU structure, which they would need to know for storing low-level code

  • high-level code is easy to understand, whereas low-level code is not

  • high-level code needs to be translated before execution, whereas machine code does not

  • high-level programs will be less memory-efficient and slower, whereas machine code will be memory-efficient and faster

19
New cards

what are the two main types of translator (with comparisons)?

compiler - translates whole code at the same time, only needed once, returns a list of errors once finished

interpreter - translates the code one line at a time, needed every time you want to run the program, returns the first error it finds and then stops (useful for debugging)

20
New cards

what is a code editor?

the main part of an IDE, where the code is written, has line numbering and auto-colour coding

21
New cards

what is a GUI builder?

it helps the programmer to design a user interface by building it up graphically rather than having to design it using source code

22
New cards

what is a run-time environment?

it allows the code to be run quickly within the IDE - done using a start/run button

23
New cards

what are error diagnostics?

they tell where the errors in your program are and often suggest ways to fix them

24
New cards

what is auto-documentation?

it helps with the maintenance of programs by extracting certain features and storing them in a separate document to give a summary of what the code does

25
New cards

what are breakpoints?

they are a common debugging tool that stop the program on certain lines so you can gather information e.g the valuable of variables