Comp Sci Flashcards

(62 cards)

1
Q

How many bits in a byte

A

8

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

How many bits in a nibble

A

4

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

Files

A

a large group of bytes in auxiliary memory

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

What is the place called where files are stored

A

directories/folders

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

Which takes precedence in the ||: True or False

A

True takes precedence

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

Which takes precedence in the &&: True or False

A

False takes precedence

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

What does an enumeration do

A

lists the values a variable can have

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

int m = 4;
int results = 3 * (++m);

A

results = 15

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

int m = 4;
int results = 3 * (m++);

A

results = 12

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

What is encoding

A

translating from one set of symbols to another set of symbols (integer to binary)

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

What are the 8 primitive data types

A

int, double, char, Boolean, float, long, short, byte

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

What are 6 comparison operators

A

==, <=, >=, !=, <, >

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

What are the 3 logical operators

A

&&, ||, !

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

Lexicographic Order rules

A

all numbers come before letters and all uppercase letters come before lowercase letters

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

What is the Lexicographic Order based on

A

based on the character order in the Unicode character set

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

What is another word for conditional operator

A

ternary operator

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

When is a boolean expression a tautology

A

when the result is always true

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

When is a boolean expression a contradiction

A

when the result is always false

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

When is a boolean expression a contingency

A

when it is neither a tautology nor a contradiction

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

Tautology/Contradiction/Contingency?

(x == y) || (x != y)

A

tautology

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

Tautology/Contradiction/Contingency?

(x == y) && (x != y)

A

contradiction

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

Tautology/Contradiction/Contingency?

(x && y)
where both x and y = boolean values

A

contingency

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

general formula for encoding

A

ceiling(log2(n))

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

general formula for encoding in English

A

see how many times we can divide by 2 (starting at n) until we reach the quotient 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the 4 types of integer values
byte, int, short, long
26
What the 2 types of floating point numbers
float, double
27
What kind of value is a character
single character
28
What kind of value is a boolean
Boolean
29
how much memory does one byte use
1 byte
30
how much memory does one int or one float use
4 bytes
31
how much memory does one short or one char use
2 bytes
32
how much memory does one long or one double use
8 bytes
33
What does ASCII stand for
American Standard Code for Information Interchange
34
How many symbols does 7-bit ASCII contain
2^7 (128 symbols)
35
How many symbols does 8-bit ASCII contain
2^8 (256 symbols)
36
Java uses _________ for ____
16-bit Unicode, char
37
what are 2 ways floating-point constant can be written as
1, numbers after decimal place 2. e notation
38
In Java, you can't store a floating-point number in a variable that is declared as an int because...
Java is said to be strongly typed
39
What is the data stored by a variable called
value
40
Which one is the assignment operator: = or ==?
=
41
RAM
random access memory
42
main memory is a type of ___________
volatile memory
43
auxiliary memory is also called...
secondary memory
44
what is a program
a finite sequence of instructions for a computer to follow written in a programming language
45
Following the instructions is called
running or executing the program
46
What is a process
a program that is currently executing
47
What does the operating system do?
oversees the operation of the computer and its main job is to manage processes and hardware resources
48
do computers understand high-level languages like java?
no which is why computers have compilers
49
what do compilers do
they translate programs from high-level languages to low-level languages
50
Does the java compiler translate from java to machine language?
no, it translates it into java byte-code
51
What happens after the Java compiler translates the program to byte-code
the interpreter translates each byte-code instruction into machine language before it moves on to the next byte-code instruction
52
The class loader...
automatically connects different classes together in Java
53
What is a package
a library of classes that have already been defined ex. java.util.Math;
54
what does a statement end with
a semicolon;
55
what are the grammar rules of code called
syntax
56
When printing to a screen (System.out.println()) which part is the object and which part is the method/function?
Object- System.out Method/Function- println
57
What is the difference between the pre-compiled version and the byte-code version of a program
they have the same name, but the pre-compiled version ends in .java, while the byte-code version ends in .class
58
What are the 3 types of errors
1. Syntax error 2. Run-time error 3. Logic/Semantic errors
59
What are syntax errors?
grammatical errors; they are shown with red squiggly line under code or smthg like that
60
What are runtime errors?
Errors that occur when you run a program (like dividing by zero or going Index Out of Bounds); the program usually terminates itself in times like this
61
What are logic/ semantic errors?
Errors that allow the program to run, but produce incorrect results like if you wanted a program that produces the sum of numbers but you accidentally put the formula as x - y. The program will still run, but it will give you the wrong value as the sum.
62
you got this
i bet i do