- J277 QUESTIONS AND CORRECT
ANSWERS
Abstraction - ans- ws ws
Hiding or removing irrelevant details from a problem to reduce complexity.
ws ws ws ws ws ws ws ws ws ws
Decomposition - ans-Breaking a complex problem down into smaller problems.
ws ws ws ws ws ws ws ws ws
Input sanitization - ans-Cleaning up data entered by removing non-
ws ws ws ws ws ws ws ws ws
standard characters. ws
Casting - ans- ws ws
Converting one data type to another, for example converting an integer to a real nu
ws ws ws ws ws ws ws ws ws ws ws ws ws ws
mber.
Sequence - ans-the order in which the program is written and executed.
ws ws ws ws ws ws ws ws ws ws ws
Variable - ans-A location for a memory
ws ws ws ws ws ws
Arrays - ans-allows multiple items of data to be stored under one identifying name
ws ws ws ws ws ws ws ws ws ws ws ws ws
SQL - ans-ws ws
SELECT (the fieldname of the data to be selected), FROM ( the name of the databa
ws ws ws ws ws ws ws ws ws ws ws ws ws ws ws
se table), WHERE (condition in a fieldname is met)
ws ws ws ws ws ws ws ws
High Level Language: - ans-- Uses English-like words
ws ws ws ws ws ws ws
- Must be translated before the processor can execute
ws ws ws ws ws ws ws ws
- Code is portable between different processors
ws ws ws ws ws ws
- Human oriented code written by programmers
ws ws ws ws ws ws
- One high level command equates to many machine code instructions
ws ws ws ws ws ws ws ws ws ws
Describe the advantages of writing the program in a high-
ws ws ws ws ws ws ws ws ws
level language instead of in assembly language (2) - ans-- Easier/
ws ws ws ws ws ws ws ws ws ws
quicker for humans to write
ws ws ws ws
- Easier/quicker to read / understand / remember
ws ws ws ws ws ws ws
- Easier/quicker to maintain / debug / spot errors
ws ws ws ws ws ws ws ws
- ...because code is closer to English / uses English words
ws ws ws ws ws ws ws ws ws ws
, - Less code to write
ws ws ws ws
- ...because one HLL instruction represents many assembly instructions
ws ws ws ws ws ws ws ws
- Portable (between processors) // will work with different types of computer
ws ws ws ws ws ws ws ws ws ws ws
Describe how a character set is used to represent the string value stored in the vari
ws ws ws ws ws ws ws ws ws ws ws ws ws ws ws
able name (2) - ans--
ws ws ws ws
Each character (in character set) has a unique (binary) number/value
ws ws ws ws ws ws ws ws ws ws
- Each character in the string is assigned its associated number/value
ws ws ws ws ws ws ws ws ws ws
- The (binary) value of each character is stored/combined (in order)
ws ws ws ws ws ws ws ws ws ws
- ... by example e.g. The binary value for D, then for r, then for u
ws ws ws ws ws ws ws ws ws ws ws ws ws ws ws
Uses ASCII/Extended ASCII/Unicode
ws ws
The vending machine is tested before it is released. (i) Explain the purpose of testin
ws ws ws ws ws ws ws ws ws ws ws ws ws ws
g the vending machine. (2) - ans-- Check the program meets the user requirements
ws ws ws ws ws ws ws ws ws ws ws ws ws
- Check the program works (as intended) // detect logic / syntax errors
ws ws ws ws ws ws ws ws ws ws ws ws
- Check the program does not crash (under invalid entry) //
ws ws ws ws ws ws ws ws ws ws
check error messages are suitable
ws ws ws ws ws
- ...allow these errors to be fixed
ws ws ws ws ws ws
- ...make sure there are no problems when released
ws ws ws ws ws ws ws ws
- Any suitable example related to the vending machine e.g. gives correct change
ws ws ws ws ws ws ws ws ws ws ws ws
CANNOT ACCEPT 'FIND ERRORS/ BUGS' OR 'FIXES ERRORS'
ws ws ws ws ws ws ws
Describe the difference between iterative testing and final testing (2) - ans--
ws ws ws ws ws ws ws ws ws ws ws
Iterative is during development // repeatedly testing after/while making changes
ws ws ws ws ws ws ws ws ws ws
- Final is when the development is (almost) complete // done after iterative testing
ws ws ws ws ws ws ws ws ws ws ws ws ws
Ways that the maintainability of the program can be improved. - ans-- Indentation //
ws ws ws ws ws ws ws ws ws ws ws ws ws
whitespace
ws
- Appropriately named variables / identifiers
ws ws ws ws ws
- Modularization / use of subroutines
ws ws ws ws ws
- Comments
ws
- Use of constants
ws ws ws
Give two reasons why computer scientists use hexadecimal to represent numbers in
ws ws ws ws ws ws ws ws ws ws ws
stead of binary. (2) - ans-- Easier/quicker to communicate / enter / write / read /
ws ws ws ws ws ws ws ws ws ws ws ws ws ws ws
remember
ws
- Less chance of input errors // easier to spot errors
ws ws ws ws ws ws ws ws ws ws
- They are smaller / shorter
ws ws ws ws ws
- Easy to convert between binary and Hexadecimal
ws ws ws ws ws ws ws
State what is meant by the term image resolution (1) - ans--
ws ws ws ws ws ws ws ws ws ws ws
Number of pixels (in an image)
ws ws ws ws ws ws
- Height and width (of an image)
ws ws ws ws ws ws
Give two ways that the file size of the image could be reduced. - ans--
ws ws ws ws ws ws ws ws ws ws ws ws ws ws
Reduce number of pixels / resolution
ws ws ws ws ws ws