COP2253 Zybooks Chapter One Flashcards

1
Q

program

A

consists of instructions executing one at a time

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

basic instruction types:

A

input, process, output

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

input

A

a program gets data from somewhere

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

process

A

a program performs computations on that data, such as adding two values

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

output

A

a program puts that data somewhere

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

variables

A

used by a program to refer to data

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

computational thinking

A

creating a sequence of instructions to solve a problem

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

algorithm

A

a sequence of instructions that solves a problem

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

a program starts in

A

main(), executing the statements within main’s braces{}, one at a time

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

each statement typically appears alone on a line and ends with a

A

semicolon ;

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

what code at the top of a file enables the program to get input?

A

import java.util.Scanner;

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

scanner

A

a text parser that can get numbers, words, or phrases from an input source such as the keyboard

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

what statement creates a Scanner object?

A

Scanner scnr = new Scanner (System.in);

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

the following statement gets an input value and assigns x with that value:

A

x = scnr.nextInt();

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

outputting text is achieved via:

A

System.out.print(“desired text”);

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

text in double quotes is known as a

A

string literal

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

outputting text with a newline after the outputted values is achieved via:

A

System.out.println(“desired text”);

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

outputting a variable’s value is achieved via:

A

System.out.print(x);

note that no quotes surround x

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

when outputting multiple items with one statement, items are separated by a

20
Q

comment

A

text a programmer adds to a code, to be read by humans to better understand the code, but ignored by the compiler

21
Q

single-line comment

A

starts with // and includes all the following text on that line

22
Q

multi-line (or block) comments

A

starts with /* and ends with */ and includes all the text in-between

23
Q

whitespace

A

blank spaces (space and tab characters) between items within a statement and blank lines (called newlines) between statements

24
Q

syntax error (a type of compile-time error)

A

to violate a programming language’s rules on how symbols can be combined to create a program

25
logic error (run-time error, or bug)
error that occurs as the program runs, even after it has compiled successfully
26
0s and 1s are known as
bits (binary digits)
27
processors
execute a list of desired calculations (called instructions)
28
memory
a circuit that can store 0s and 1s in each of a series of thousands of addressed locations
29
a programmer created sequence of instructions is called a
program, application, or just app
30
the processor starts by executing the instruction at location
0
31
machine instructions
instructions represented as 0s and 1s
32
executable program
a sequence of machine instructions
33
assemblers
programs that automatically translate human-readable instructions, known as assembly language instructions, into machine instructions
34
high-level languages
support programming using formulas or algorithms
35
compilers
programs that automatically translate high-level language programs into executable programs
36
bytecode
a compiler-generated executable using machine instructions of a "virtual" processor
37
virtual machine
executes the instructions in the bytecode
38
a computer consists of several components
input/output devices, storage, memory, processor, operating system, clock
39
output device
a screen or monitor displays items to a user
40
input device
a keyboard (or touchscreen) allows a user to provide input to the computer
41
storage
a disk (or hard drive) stores files and other data
42
RAM
RAM (random-access memory) temporarily holds data read from storage
43
operating system
allows a user to run other programs and interfaces with the many other peripherals
44
cache memory
a small amount of RAM contained on the processors own chip
45
clock
governs the rate at which a processor executes instructions
46
Moore's law
the doubling of integrated circuit capacity roughly every 18 months (originally 2 years)