1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Seven Steps in Program Development
Define the problem. 2. Outline the solution. 3. Develop the outline into an algorithm. 4. Test the algorithm for correctness (desk check). 5. Code the algorithm into a specific programming language. 6. Run the program on the computer. 7. Document and maintain the program.
Three Approaches to Program Design
Procedure-driven (focuses on tasks/functions). 2. Event-driven (focuses on actions like mouse clicks). 3. Data-driven (focuses on the analysis and structure of data).
Computer Program
A program is a related series of instructions that, when directed through computer hardware, produce desired results to solve an identified problem.
Meaningful Names in Programming
They act as transparent identifiers for storage locations, making the code easier to read and maintain.
Desk Check
A desk check involves 'walking' through an algorithm on paper using simple test data to simulate computer execution.
Logic Errors
Identified during desk checks; these are mistakes in the thinking or sequence that produce wrong results.
Bug
A bug is an error in a program.
Types of Bugs
Syntax errors: Grammatical mistakes detected at compile time. 2. Logic errors: Mistakes in the thinking that produce wrong results. 3. Run-time errors: Errors that occur during execution.
Variable
A named memory location where the stored value can change while the program runs.
Constant
A named value that remains fixed throughout execution.
Boolean Variable
An elementary data type that can hold only one of two possible values, typically true or false.
Record
A group of related data items that describe one thing.
File
A collection of many related records.
Array
A list of items of the same data type stored under one name and accessed using an index.
String
A group of characters treated as a single unit.
Elementary Data Types
Integer. 2. Real (floating point). 3. Character. 4. Boolean.
Control Structures
Sequence: Instructions executed in order. 2. Selection: Making decisions (IF-THEN-ELSE). 3. Repetition: Repeating actions while a condition is true.
WHILE…DO Loop
A leading-decision loop that tests the condition before execution.
REPEAT…UNTIL Loop
A trailing-decision loop that tests the condition at the end, always running at least once.
FOR-loop
A counted loop used when the number of repetitions is known in advance.
Logical Operators: AND vs OR
AND requires all conditions to be true; OR requires at least one condition to be true.
IPO Model: Total Cost of Coffee Beans
Input: Number of bags, Cost per bag; Processing: Calculate total cost = (Number of bags × Cost per bag); Output: Total cost.
IPO Model: Miles to Kilometers
Input: Distances (Miles); Processing: Calculate Kilometers = (Miles / 0.621371); Output: Converted distances in Kilometers.
IPO Model: VAT Calculation
Input: Customer name, item name, purchase amount, VAT code; Processing: Set tax based on code; Output: Customer name, item name, total amount due.
IPO Model: Voting Eligibility
Input: Current year, birth year; Processing: Calculate age; Output: Voting eligibility message.