Programming Flashcards
What is a variable?
Component that allows us to store data
What are the data types, and what do they store?
5
- String: Stores texts and numbers
- Char: Stores single characters
- Integer: Stores negative & positive whole numbers
- Single/Real: Stores negative & positive decimal numbers
- Boolean: Stores either true or false
What is an input?
Data that is put into the program
What is a process?
A calculation or evaluation within the program
What is an output?
Data that is displayed to the user
What is the purpose of a logical operator?
To join two or more conditions together to make a complex condition
What are the logical operators and their functions?
- AND: Both conditions must be true for the complex condition to be evaluated as true
- OR: Either condition must be true for the complex condition to be evaluated as true
- NOT: Inverts a true to a false and a false to a true
What is iteration?
When a section of code is executed several times, which makes the program more efficient and error free.
What are the two types of iteration?
Fixed loop & Conditional Loop
What are the two types of conditional loops and their functions?
- Do while: used when there is a condition that is true
- Do until: used when we start with the code that repeats
What are the 6 stages of development?
- Analysis
- Design
- Implementation
- Testing
- Documentation
- Evaluation
Stages of Development
What is the iterative process?
When a process is repeated, such as revisiting an earlier stage when encountering a problem
Stage 1:
Describe the analysis stage
During the analysis stage, you create a document called the software specification, which lists all the functional requirements of the program (inputs, processes and outputs)
Stage 2:
Describe the design stage
During the design stage, one of three design methods is used as well as the user interface being designed so that it is comfortable to use. Program should be designed efficiently.
What are the three design techniques used and their features?
- Psuedocode: human readable design method used to write out inputs, processes, outputs and refinements before they are coded
- Structure diagram: graphical design method describing the steps of a program, read top to bottom and left to right
- Flow chart: graphical design method describing the steps of a program, read from top to bottom
Stage 3:
Describe the implementation stage
During the implementation stage, the design is translated into code and written in the appropriate programming language
Stage 4:
Describe the testing stage
During the testing stage, the program is tested whilst it is being written and after. A set of test data is used and put into a recorded table.
Stage 5:
Describe the documentation stage
During the documentation stage, a record is kept of important information about the program including:
* Software specification
* Design notation
* Listing of all code
* Test table
Stage 6:
Describe the evaluation stage
During the evaluation stage, we make sure that the code is efficient and useable
What is an array?
A data structure which allows multiple pieces of data to be stored in an index
What is string concatenation?
When two or more strings are added together - can be done with + or & symbols
What is a predefined function?
A piece of reusable code that performs a function that has already been defined
What are the predefined functions and their purposes?
- Random: selects a random number between two numbers selected by the programmer
- Round: will round a number up or down depending on it’s decimal place / numbers.
- Length: will return the number of characters in a string or how many items are being stored in an array
What is a standard algorithm?
A solution to common problems in programming
What are the standard algorithms and their functions?
- Input validation: used to check that input is valid and won’t break the program, makes it robust
- Running total: used to continually add numbers to a total variable in a loop
- Traversing an array: used to travel through an array and access the data in each index to carry out a process
What are test tables?
Used to record test data, expected results and the actual results
What are the three types of data used in test tables and their definitions?
- Normal: within limits of program
- Extreme: on the edge of the limits
- Exceptional: data not within the limits or wrong data type
What are the three types of errors and their definition?
- Logic: error in a condition, program will still run but may return an unexpected output
- Execution: where the program does not work due to an issue such as trying to divide by 0 or a missing file
- Syntax: usually a spelling error or grammar mistake
What is evaluated in a program?
- Fit for purpose
- Efficient use of coding constructs
- Robustness
- Readability
What is meant by fit for purpose?
Does the code meet the requirements set out in the analysis stage, and if not why?
What is meant by efficient use of coding constructs?
Have loops, if statements and arrays been used if applicable?
What is meant by robustness?
Can the program handle incorrect data input, and does it make use of input validation?
What is meant by readability?
In order for code to be readable it should include:
* Internal comments
* Meaningful identifiers
* Indentation
* White space