Comp 1010 Flashcards

You may prefer our related Brainscape-certified 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
Q

How to declare a variable

A

[type] [identifier/nameOfVariable]=[expression/value];

26
Q

How to specify multiple variables in one line

A

Separate with comas

27
Q

Rules for variable names

A

Can only contain ascii letters, decimal digits, underscores

Cannot start with a number

Style

28
Q

Style rules for variables

A

Approximately 50 reserved words that can’t be used as var name

camelCase

29
Q

Size command creates two usable variables

A

width

height

30
Q

Literals

A

Data that is typed/hard coded

31
Q

Line thickness

A

strokeWeight()

32
Q

If you try to change a constant later in the program

A

Result is an error

33
Q

Use constants for which kind of literals

A

Non trivial literals

34
Q

Orded of types

A

double – float – long — int – short – byte

35
Q

x/o =

A

ERROR

36
Q

Overflow

A

too big data type for the memory of the data type

can give strange results

37
Q

casting

A

(float) x