Big Idea 1 CSP
Computing Innovation
● includes a program as an integral part of its function.
● can be physical (e.g., self-driving car), nonphysical computing software (e.g., picture editing software),or a nonphysical computing concept (e.g., e-commerce).
●Hardware is the physical components of a computing device
● Software is the instructions in a programming language to the computing device
● Moore’s law predicts that the size of transistors halves every two years while the cost also halves every two years. Computers went from taking up 1,800 square feet and weighing almost 50 tons to being able to fit in your pocket
Function and Purpose of a program
●A function of a program is how a program behaves during execution and is usually described by how the user interacts with it.
●The purpose of a program is the goal or the motivation for writing a program. One purpose is to solve problems or to pursue interests
through creative expression or to provide entertainment(e.g. write a game).
● Specification defines the requirements for the program Program Development Process
● A program is a collection of program statements that performs a specific task when run by a computer. A program is often referred to as software.
● A code segment refers to a collection of program statements that are part of a program.
●Incremental Development – breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.
● Iterative Development – requires refinement and revision based on feedback, testing, or reflection throughout the process. This may require revisiting earlier phases of the process.
● Documentation – written description of the function of a code segment, event, procedure, or program and how it was developed.
○ Explains how the software is built, how to use it, how to operate it
○ Makes it easier for users or future developers to understand the software’s functionalities and logic
○ Good for collaboration
○ Comments are a form of documentation
Types of Errors
●Syntax error – Syntax errors occur when the code does not conform to the rules of the programming language. These errors are detected at compile time, meaning the program will not start executing until these errors are corrected.
○ EX: Misspelling a keyword, omitting punctuation like semicolons or braces, or incorrect use of operator precedence.
● Runtime error – happens during the execution of the program, after it has successfully compiled. These errors typically occur because the program attempts an operation that is impossible to carry out.
○ EX: Dividing by zero, trying to access a non-existent file, or using an invalid array index. These errors may cause the program to crash or behave unexpectedly.
● Logical error – Logical errors occur when the program runs without crashing, but produces incorrect results. These are often the hardest errors to find because they
require understanding what the program is supposed to do.
○ EX: Incorrectly using a formula, failing to consider certain conditions in a loop, or errors in the way that algorithm steps are sequenced. Effective ways to find and correct errors:
●Test Cases – defining specific inputs where the expected output is known
●Hand Tracing – going through the code step by step to understand what it does with given inputs. Like simulating computer’s execution process in your mind or on paper
●Visualizations – using diagrams to represent execution of code
●Debuggers – executing code step by step and inspecting variables