Week 1 Flashcards

1
Q

Program

A

A program is a sequence of instructions that specifies how to perform a computation on computer hardware.

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

Programming

A

The process of breaking down a large, complex task into smaller and smaller subtasks.

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

Method

A

A method is a named sequence of statements.

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

What is the relation between class name and file name?

A

The name of the class has to match the name of the file it is in

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

What are comments?

A

The line that begins with two slashes (//) is a comment, which is a bit of English text that explains the code.

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

What are the advantages of high-level languages?

A
  1. It is much easier to program in a high-level language.
  2. High-level languages are portable, meaning they can run on different kinds of computers with few or no modifications.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which two kinds of programs translate high-level languages into low-level languages?

A

Interpreters and compilers.

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

What is an Interpreter?

A

An interpreter reads a high-level program and executes it, meaning that it does what the program says. It processes the program a little at a time, alternately reading lines and performing computations.

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

What is a compiler?

A

A compiler reads the entire program and translates it completely before the program starts running.

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

What is source code?

A

The high-level program is called the source code.

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

What is the translated program called?

A

The translated program is called the object code, or the executable.

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

What is an algorithm?

A

An algorithm is a sequence of steps that specifies how to solve a problem. Some algorithms are faster than others, and some use less space in computer memory.

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

What is Computer Science?

A

Computer science is the science of algorithms, including their discovery and analysis.

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

What are bugs? And what is debugging?

A

For historical reasons, programming errors are called bugs, and the process of tracking them down and correcting them is called debugging

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

What is a Variable?

A

A variable is a named location in memory that stores a value.

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

What is a Value?

A

Values may be numbers, text, images, sounds, and other types of data.

17
Q

What are compile-time errors?

A

Compile-time errors occur when you violate the rules of the Java language.

18
Q

What is Parsing?

A

Parsing is the process of reading a program before translating

19
Q

What is a Logic Error?

A

A logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally (or crash).

20
Q

What is a Run-Time Error?

A

An error that dWoes not appear until after the program has started running.

21
Q

What is the meaning of the class system?

A

System is a class that provides methods related to the “system”, or environment, where programs run.

22
Q

What is the Java Library?

A

An extensive collection of classes that you can use in your programs.

23
Q

What does the import statement in “import java.util.Scanner;” mean?

A

This import statement tells the compiler that when you refer to Scanner, you mean the one defined in java.util. Using an import statement is necessary because there might be another class named Scanner in another package.

24
Q

What are the language elements from smallest to greatest?

A

Token, Expression, Statement, Method, Class, Package

25
Q

What are tokens?

A

Tokens are the most basic elements of a program, including numbers, variable names, operators, keywords, parentheses, braces, and semicolons.

26
Q

What are constants?

A

Variables declared as final are called constants. By convention, names for constants are all uppercase, with the underscore character (_) between words.

27
Q

What is short-circuit evaluation?

A

Ignoring the second operand, when possible, is called short-circuit evaluation, by analogy with an electrical circuit.