Docsity

Computer Science study guide test and the mark scheme, Exams of Computer Science

Toggle sidebar
bg1
Computer Science study guide test and
the mark scheme
Abstraction - Correct Answer Hiding or removing irrelevant details from a problem to
reduce complexity.
Decomposition - Correct Answer breaking a complex problem down into smaller
problems.
Input sanitization - Correct Answer Cleaning up data entered by removing non-
standard characters.
Casting - Correct Answer Converting one data type to another, for example
converting an integer to a real number.
Sequence - Correct Answer the order in which the program is written and executed.
Variable - Correct answer a location for a memory
Arrays - Correct Answer allows multiple items of data to be stored under one
identifying name
SQL - Correct Answer SELECT (the fieldname of the data to be selected), FROM
(the name of the database table), WHERE (condition in a fieldname is met)
High Level Language: - Correct Answer - Uses English-like words
- Must be translated before the processor can execute
- Code is portable between different processors
- Human oriented code written by programmers
- One high level command equates too many machine code instructions
Describe the advantages of writing the program in a high-level language instead of in
assembly language (2) - Correct Answer - Easier/quicker for humans to write
- Easier/quicker to read / understand / remember
- Easier/quicker to maintain / debug / spot errors
- ...because code is closer to English / uses English words
- Less code to write
- ...because one HLL instruction represents many assembly instructions
- Portable (between processors) // will work with different types of computer
Describe how a character set is used to represent the string value stored in the variable
name (2) - Correct Answer - Each character (in character set) has a unique (binary)
number/value
pf3
pf4
pf5

Partial preview of the text

Download Computer Science study guide test and the mark scheme and more Exams Computer Science in PDF only on Docsity!

Computer Science study guide test and

the mark scheme

Abstraction - Correct Answer Hiding or removing irrelevant details from a problem to reduce complexity. Decomposition - Correct Answer breaking a complex problem down into smaller problems. Input sanitization - Correct Answer Cleaning up data entered by removing non- standard characters. Casting - Correct Answer Converting one data type to another, for example converting an integer to a real number. Sequence - Correct Answer the order in which the program is written and executed. Variable - Correct answer a location for a memory Arrays - Correct Answer allows multiple items of data to be stored under one identifying name SQL - Correct Answer SELECT (the fieldname of the data to be selected), FROM (the name of the database table), WHERE (condition in a fieldname is met) High Level Language: - Correct Answer - Uses English-like words

  • Must be translated before the processor can execute
  • Code is portable between different processors
  • Human oriented code written by programmers
  • One high level command equates too many machine code instructions Describe the advantages of writing the program in a high-level language instead of in assembly language (2) - Correct Answer - Easier/quicker for humans to write
  • Easier/quicker to read / understand / remember
  • Easier/quicker to maintain / debug / spot errors
  • ...because code is closer to English / uses English words
  • Less code to write
  • ...because one HLL instruction represents many assembly instructions
  • Portable (between processors) // will work with different types of computer Describe how a character set is used to represent the string value stored in the variable name (2) - Correct Answer - Each character (in character set) has a unique (binary) number/value
  • Each character in the string is assigned its associated number/value
  • The (binary) value of each character is stored/combined (in order)
  • ... by example e.g. the binary value for D, then for r, then for u Uses ASCII/Extended ASCII/Unicode The vending machine is tested before it is released. (I) explain the purpose of testing the vending machine. (2) - Correct Answer - Check the program meets the user requirements
  • Check the program works (as intended) // detect logic / syntax errors
  • Check the program does not crash (under invalid entry) // check error messages are suitable
  • ...allow these errors to be fixed
  • ...make sure there are no problems when released
  • Any suitable example related to the vending machine e.g. gives correct change CANNOT ACCEPT 'FIND ERRORS/ BUGS' OR 'FIXES ERRORS' Describe the difference between iterative testing and final testing (2) - Correct Answer - Iterative is during development // repeatedly testing after/while making changes
  • Final is when the development is (almost) complete // done after iterative testing Ways that the maintainability of the program can be improved. - Correct Answer - Indentation // whitespace
  • Appropriately named variables / identifiers
  • Modularization / use of subroutines
  • Comments
  • Use of constants Give two reasons why computer scientists use hexadecimal to represent numbers instead of binary. (2) - Correct Answer - Easier/quicker to communicate / enter / write / read / remember
  • Less chance of input errors // easier to spot errors
  • They are smaller / shorter
  • Easy to convert between binary and hexadecimal State what is meant by the term image resolution (1) - Correct Answer - Number of pixels (in an image)
  • Height and width (of an image) Give two ways that the file size of the image could be reduced. - Correct Answer - Reduce number of pixels / resolution
  • Reduce number of colors
  • Use lossy compression
  • Use lossless compression
  • Suitable example (e.g. 17) Taylor used computational thinking techniques to develop the algorithms. Give two computational thinking techniques that Taylor has used, describing how they have been used. (4) - Correct Answer - Abstraction
  • ... focusing on the important elements // ignoring elements that do not contribute to the solution // simplifying the problem
  • Decomposition
  • ...breaking a problem down (into its constituent parts) • Algorithmic thinking
  • ...set out the steps needed to solve the problem // represented in a flow chart / as pseudocode State one difference between a variable and a constant. - Correct Answer Contents of variable can be changed; contents of constants cannot be changed (while the programming is running) BOTH NEEDED FOR A MARK Computers make use of electronic switches called transistors. Describe how transistors can be used to store a value in binary. - Correct Answer Transistor has two states • 1 represents on, 0 represents off • each transistor stores one bit • Multiple transistors used to store a binary value Azmi says, "Hexadecimal is used because it takes up less storage space in the computer's memory than binary." - Correct Answer He is incorrect because: Data cannot be stored in hexadecimal // all data is stored in binary // hexadecimal is a shortcut for computer scientists Something that functions do which procedures don't - Correct Answer Returns a value A computer game is written in a high-level programming language. (a) State why the computer needs to translate the code before it is executed. - Correct Answer - To convert it to binary/machine code
  • The processor can only understand machine code Either a compiler or an interpreter can translate the code. Describe two differences between how a compiler and an interpreter would translate the code (4) - Correct Answer - Compiler translates all the code in one go...
  • ...whereas an interpreter translates one line at a time
  • Compiler creates an executable...
  • ...whereas an interpreter does not/executes one line at a time - Compiler reports errors at the end...
  • ...whereas an interpreter stops when it finds an error What is a constant? - Correct Answer - The number does not need to be changed while the program is running
  • The number can be updated once and it updates throughout For example: Pi (e) An Integrated Development Environment (IDE) is used to write the program. Identify two features of an IDE that might be used when writing the program. (2) - Correct Answer - Error diagnostics (any example)
  • Run-time environment
  • Editor (any feature such as auto-correct, auto-indent)
  • Translator
  • Version control
  • Break point
  • Stepping A teacher researches the length of time students spend playing computer games each day. Identify the data type you would choose to store the data and explain why this is a suitable data type. (2) - Correct Answer Integer (1)...
  • ...number of seconds not important (1)
  • ... level of accuracy not needed so round to nearest minute (1) • ...using a decimal to store seconds (0-60) is not appropriate Real (1)...
  • ... number of seconds may be important (1)
  • ... allows parts/fractions to be stored over integers (1) A radio station records an interview with a computer scientist using a computer and audio recording software. (I) explain how sampling is used to store audio recordings (2) - Correct Answer - Height/amplitude of waveform is sampled/measured
  • Converted to / stored as binary/digital
  • Sample / measurements taken at a regular interval / set interval / by sensible example (e.g. 44,000 times per second) Define what is meant by the term sampling frequency (1) - Correct Answer - number of samples taken per second / per time period
  • How often/regularly a sample is taken The effects of increasing the sampling frequency - 2 - Correct Answer - The file size of the digital recording will be larger.
  • The quality of playback of the digital recording will be better. The radio station uses a digital camera to take a photograph of the computer scientist for their website. The photograph is stored as a bitmap image. (I) describe how bitmap images are represented in binary. (3) - Correct Answer - mage made of / split up into pixels
  • Each pixel given a binary code...
  • ...which represents the color of that pixel
  • Each color is given a different/unique binary code.
  • ...checking whether input data should be allowed / is sensible / follows criteria
  • ...by example (e.g. goals cannot be less than 0)
  • Verification
  • ... checking whether data has been entered correctly
  • ...by example (e.g. double entry / visual check) Authentication
  • ...ensuring only allowed / authorized users can gain access
  • ...by example (e.g. usernames /passwords)
  • Maintainable code
  • ...to allow other programmers to understand the code
  • ...by example (e.g. comments, indentation, meaningful variable names)