Input, Processing and Output Flashcards
What are the two key steps in program design?
- Understand the task the program will perform.
- Determine the steps needed to perform the task.
What is an algorithm?
A well-defined logical sequence of steps to perform a task.
What are pseudocode and flowcharts used for in program design?
Pseudocode is used to focus on design without syntax rules, and flowcharts graphically represent program steps.
What symbols are used in flowcharts, and what do they represent?
- Terminal symbols: Start/End (Ovals)
- Input/Output symbols: Input/Output operations (Parallelograms)
- Processing symbols: Process steps (Rectangles)
- Connector symbols: Connect different parts (Small circles)
What is the difference between a syntax error and a logic error?
- Syntax error: Violation of language rules.
- Logic error: Program runs but produces incorrect results.
What are the three steps in the Input, Processing, Output (IPO) structure?
- Receive input
- Process data
- Produce output
What is an IPO chart?
A planning tool that describes a program’s input, processing, and output.
What are the three main control structures in programming?
- Sequence
- Selection
- Repetition
What is a variable in programming?
A named storage location in memory that holds data.
What are the rules for naming variables?
- Must be one word (no spaces).
- Usually no punctuation, only letters and numbers.
- First character cannot be a number.
- Should indicate purpose.
- Multiword names use underscore or camelCase.
What is a string in programming?
A sequence of characters used as data.
What is a string literal?
A string value written directly in the program code, enclosed in quotation marks.
What is an assignment statement?
A statement that sets a variable to a specified value.
What is the order of operations in math expressions?
- Parentheses
- Exponents
- Multiplication/Division/Modulus (left to right)
- Addition/Subtraction (left to right)
What is the difference between an integer and a real number?
- Integer: No decimal point.
- Real number: Includes a decimal point.
What is a named constant?
A value that cannot be changed during execution, typically declared in ALL_UPPERCASE naming.
What is the purpose of program documentation?
To explain how the program works, through external documentation for users and internal comments in the code.
What are the types of comments in programming?
- Block comments: Multi-line, for lengthy explanations.
- Line comments: Brief, for specific statements.