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.
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:
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
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.
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.
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.
Chapter 2: Data