Comp 1010 Flashcards
In line comment
//comment
Multi line comment
/*
*/
Data is separated by
Comas
Syntax highlights
Coloring commands
Various versions of command means
Various parameters requiered
Compile type error
Prevents you from compiling
Execution type errors
Compile but can’t run
Logic errors
Runs but not as expected
How to use comments to debug
Commenting out the command to see where the issue is
What is comp programming
Problem solving
Most programming languages
Are similar
How to calculate the number of operations performed each seconds by a computer?
n operations/s/cores * n of cores = n of operations/s
Line
line(xstart, ystart, xend, yend);
Size of the canva
size(w, h)
Triangle
triangle(x1, y1, x2, y2, x3, y3);
Ellipse
ellipse(xcenter, ycenter, w, h);
Ints
Integer relatives
Comprised between 2×10⁹ and -2×10⁹
Data type
Println
Displays any data on the console
Percentages
Int percent
Unable the programmer to see the value of the variable
println(nameOfTheVariable);
Debugging a code
Removing errors and problems that stop the program from running as expected
How to name a constant
ALL_CAPS_AND_UNDERSCORES
Create a named constant
final datatype CONSTANT_NAME
What is a variable
What you use to store data
A small piece of memory