Midterm1 Flashcards

(60 cards)

1
Q

A sequence of instruction that specifies how to preform computation

A

Program

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

The science of algorithms including discovery and analysis

A

Computer Science

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

Sequence of steps that solves a problem

A

Algorithm

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

Programming errors.

A

Bugs

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

Examples of high level languages?

A

Java Phython C C++ Ruby & JavaScript

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

Examples of low level languages

A

Machine Language

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

Why is it better to write programs in high level languages?

A

They are easier to program and read and they are also portable (run on different types of computers)

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

Reads high level languages. It does what the program says. Processes the programs a little at a time alternating reading lines and preforming computation.

A

The Interpreter

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

Reads entire program and translates it before running.

A

The Compiler

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

High level program translated to object code or executable

A

Source code

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

The process of finding and removing errors

A

Debugging

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

A special kind of object code used for Java programs. Similar to low level language but portable like high level language.

A

Byte Code

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

Part of a program that specifies one step of an algorithm. Line of code that preforms a basic operation.

A

Statement

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

A named sequence of statements

A

Method

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

A collection of related methods

A

Class

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

A part of a program that contains information about the program but has no effect when the program runs

A

Comment

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

A sequence of characters; the primary data type for text.

A

String

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

A statement that causes output to be displayed on the screen

A

Print Statement

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

A special character signifying the end of a line of text. Also known as line ending or line break

A

Newline

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

A sequence of code that represents a special character when used inside a string.

A

Escape Sequence

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

Escape sequence for a new line

A

\n

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

Escape sequence for double quote

A

"

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

Escape sequence for tab

A

\t

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

Escape sequence for backslash

A

\

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Process of compiling and running a Java program
source code -> compiler -> compiler -> byte code -> interpreter -> output
26
Command Line for compiling a program named Hello
javac Hello.java
27
Command Line for Running a program named Hello
java Hello
28
``` Which is incorrect and why? int x =1.1; double y=1; double y=1/3; double 1.0/3.0; ```
1. //compile error 2. //legal ut bad style 3. //common mistake. It divides 2 integers so get 0.0 then it converts to a double 4. //correct
29
What data type should you use for absolute precision?
Integers. When adding doubles the rounding errors will accumulate.
30
Output for System.out.print("Hello" + 1 + 2);
Hello12
31
System.out.print(1+2+"Hello");
3Hello
32
Precedence of numeric variables
( ), (+,-)positive or negative signs, * / multiplicative, + - additive, = assignments
33
Byte
1 byte -128 to 127
34
short
2 byte -32,768 to 32,767
35
int
4 bytes -2^31 to 2^31 -1
36
long
8 bytes -2^63 to 2^63 -1
37
Examples of Compile time Errors
When syntax rules are violated, parsing errors, braces and parenthesis don't match, semicolon missing, tells where error occurred sometimes not helpful
38
Examples of Runtime Errors
"exceptions" when program is running
39
Logic Error
compiles and runs but doesn't do right thing. You have to work backwards to find the problem. Usually hard to fix.
40
Name storage location for values type is declared when variable created.
variable
41
number, string, or other data that can be stored in a variable. Every value belongs to a type(for example, int or String)
value
42
Statement that creates new variable and specifies its type
Declaration
43
Set of values. Type determines which values it can have
Type
44
Reserved word for compiler for analyze programs. Can't be used as variable names. Examples: public class and void
Keyword
45
A group of classes related to each other
package
46
Location of value in computer memory (hexadecimal integer)
address
47
Collection of packages and classes that are available for use in other programs
library
48
Allows programs to use classes defined in other packages
import statement
49
Basic element of a program (word, space, symbol or number)
Token
50
Value that appears as source code. Ex. "Hello" is a String ____ and 74 is an integer _____
literal
51
Number that appears without explanation as part of an expression
magic number
52
Variable, declared final, value cannot be changed
Constant
53
String passed through printf to specify format of output
format string
54
Special code beginning with % sign specific data type and format of corresponding value
format specifier
55
Operator converts one data type to another
type cast
56
Operator that gives a remainder in integer division
modulus
57
Value you provide when invoke method. Value must have same type as corresponding parameter
Argument
58
Cause method to execute. "calling" a method
Invoke
59
Info method require before can run. Are variables contain values and types
Parameter
60
Order in which Java executes method and statements. Not always starts at top
Flow of execution