Comp 1010 Flashcards

1
Q

In line comment

A

//comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Multi line comment

A

/*

*/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Data is separated by

A

Comas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Syntax highlights

A

Coloring commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Various versions of command means

A

Various parameters requiered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compile type error

A

Prevents you from compiling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Execution type errors

A

Compile but can’t run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Logic errors

A

Runs but not as expected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to use comments to debug

A

Commenting out the command to see where the issue is

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is comp programming

A

Problem solving

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Most programming languages

A

Are similar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to calculate the number of operations performed each seconds by a computer?

A

n operations/s/cores * n of cores = n of operations/s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Line

A

line(xstart, ystart, xend, yend);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Size of the canva

A

size(w, h)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Triangle

A

triangle(x1, y1, x2, y2, x3, y3);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Ellipse

A

ellipse(xcenter, ycenter, w, h);

17
Q

Ints

A

Integer relatives

Comprised between 2×10⁹ and -2×10⁹

Data type

18
Q

Println

A

Displays any data on the console

19
Q

Percentages

A

Int percent

20
Q

Unable the programmer to see the value of the variable

A

println(nameOfTheVariable);

21
Q

Debugging a code

A

Removing errors and problems that stop the program from running as expected

22
Q

How to name a constant

A

ALL_CAPS_AND_UNDERSCORES

23
Q

Create a named constant

A

final datatype CONSTANT_NAME

24
Q

What is a variable

A

What you use to store data

A small piece of memory

25
How to declare a variable
[type] [identifier/nameOfVariable]=[expression/value];
26
How to specify multiple variables in one line
Separate with comas
27
Rules for variable names
Can only contain ascii letters, decimal digits, underscores Cannot start with a number Style
28
Style rules for variables
Approximately 50 reserved words that can't be used as var name camelCase
29
Size command creates two usable variables
width height
30
Literals
Data that is typed/hard coded
31
Line thickness
strokeWeight()
32
If you try to change a constant later in the program
Result is an error
33
Use constants for which kind of literals
Non trivial literals
34
Orded of types
double -- float -- long --- int -- short -- byte
35
x/o =
ERROR
36
Overflow
too big data type for the memory of the data type | can give strange results
37
casting
(float) x