Big Idea 1: Creative Development

Collaboration

  • Programming is a collaborative and creative process that brings ideas to life through the development of software.

  • Software development processes used in the industry often require students to work together in teams.

  • Collaboration can take place at various points and in various ways.

  • An important concept that is discussed throughout the entire course is the idea of computing innovations.

  • A computing innovation uses a computer program to take in data, transform data and output data.

  • Collaboration can occur in the planning, designing, or testing (debugging) part of the development process.

    • Collaboration tools allow students and teachers to exchange resources in several different ways, depending on what suits a particular task.

  • Collaborative learning can occur peer-to-peer or in larger groups.

  • Peer instruction involves students working in pairs or small groups to discuss concepts to find solutions to problems.

Identifying and Correcting Errors

There are 4 main types of errors in programming:

  • Syntax Error: A mistake in which the rules of the programming language are not followed.

    • Mistake in the way that a code is written

    • Prevents code from compiling

  • For Example:

a ← expression

DISPLAY (A)

A syntax error in this example occurs because the second statement attempts to display the variable A, which is not the defined variable. Variable names are case sensitive. Therefore, while the variable with a lowercase a in lowercase is defined by the first statement, the variable with a capital A in the second not defined. Therefore, the rules of the programming language were violated

  • Runtime Error: A mistake that occurs during the execution of a program that ceases the execution.

    • Unable to run to completion

  • For example:

DISPLAY (5/0)

In this example, there is no syntax error, because the language of the code is used correctly. However, this causes a runtime error because you cannot divide by zero. The execution of the program will halt at this line.

  • Another common example: Trying to access an array element with an index that is out of bounds.

  • Logic Error: A mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.

    • Harder to detect because the code can still run without any immediate signs of errors

    • For example: Adding two numbers but consistently getting the wrong answers

  • For example:

a 95

IF (a > 90)

DISPLAY("You got an A.")

IF (a > 80)

DISPLAY("You got a B.")

IF (a > 70)

DISPLAY("You got a C.")

  • The code in intended to correctly printout what grade the student got. Since this particular student's score was a 95, which is greater than 90, the program should display You got an A. However, the program actually prints out the following:

You got an A.

You got a B.

You got a C.

This logic error occurs because the students score is also greater than 80 and 70 with no restriction that prevents multiple grades from being printed.

  • Overflow Error: A mistake that occurs when a computer attempts to handle a number that is outside of the defined range of values.

  • Related to numerical calculations

    • Happens when the program tries to handle numbers that are too large for the designated variable type

  • For example:

x - 2000*365

DISPLAY (x)

The result is of the multiplication is a large number. In many languages, this product would be large enough to be outside the range of certain data types. Therefore, if x is defined as a variable of one of those data type, this multiplication will cause an overflow error.

  • Debugging: is the process of finding and fixing errors.

    • You should use test cases, extra output statements, examination for syntax errors and other debugging tools to find and fix any errors.

Readability and Maintainability

  • Should adopt and adhere to a consistent coding standard

Types of Algorithms:

  • Binary Search/Linear Search

  • Stream processing algorithms

    • Designed to handle continuous, high-volume data streams

    • Ideal for analyzing trends

  • Quick sort

    • Divide and conquer

    • An array is divided in sub-arrays

  • Depth-first search

    • Uses backtracking