Practical Prgramming Tequniques Flashcards
What is a program?
A program is a set of instructions written in a programming language to perform a specific task.
What is pseudocode?
Pseudocode is a simplified, human-readable way of writing algorithms without using specific programming syntax.
What is a flowchart?
A flowchart is a diagram that represents an algorithm using standard shapes to show the flow of control.
Why is planning a program important?
Planning helps identify the structure, logic, and purpose of the program before coding, reducing errors and improving efficiency.
What does testing a program mean?
Testing means running a program with various inputs to check that it behaves correctly and meets the requirements.
What is debugging?
Debugging is the process of finding and fixing errors or bugs in a program.
What is a syntax error?
A syntax error occurs when the code breaks the rules of the programming language, such as missing colons or brackets.
What is a logic error?
A logic error is when the program runs without crashing but produces incorrect results due to a flaw in the algorithm or logic.
What is a runtime error?
A runtime error is an error that occurs while the program is running, such as dividing by zero or accessing an index that doesn’t exist.
How can you prevent errors in your program?
Use proper testing, validation, debugging tools, and follow good programming practices like using clear variable names and adding comments.
What is a test plan?
A test plan is a document that outlines what inputs will be tested, what the expected outputs are, and how the results will be verified.
What are the types of test data?
The main types are: normal data (expected), boundary data (at the limits), erroneous data (invalid), and extreme data (beyond expected limits).
What does refining a program mean?
Refining involves improving code readability, efficiency, and maintainability, often by restructuring or simplifying parts of the program.
Why are comments useful in code?
Comments help explain what code does, making it easier for others (or yourself later) to understand and maintain.
What is meant by maintainability in programming?
Maintainability refers to how easily code can be modified, debugged, or updated in the future.