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

A

+ symbol

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
Q

logic error (run-time error, or bug)

A

error that occurs as the program runs, even after it has compiled successfully

26
Q

0s and 1s are known as

A

bits (binary digits)

27
Q

processors

A

execute a list of desired calculations (called instructions)

28
Q

memory

A

a circuit that can store 0s and 1s in each of a series of thousands of addressed locations

29
Q

a programmer created sequence of instructions is called a

A

program, application, or just app

30
Q

the processor starts by executing the instruction at location

A

0

31
Q

machine instructions

A

instructions represented as 0s and 1s

32
Q

executable program

A

a sequence of machine instructions

33
Q

assemblers

A

programs that automatically translate human-readable instructions, known as assembly language instructions, into machine instructions

34
Q

high-level languages

A

support programming using formulas or algorithms

35
Q

compilers

A

programs that automatically translate high-level language programs into executable programs

36
Q

bytecode

A

a compiler-generated executable using machine instructions of a “virtual” processor

37
Q

virtual machine

A

executes the instructions in the bytecode

38
Q

a computer consists of several components

A

input/output devices, storage, memory, processor, operating system, clock

39
Q

output device

A

a screen or monitor displays items to a user

40
Q

input device

A

a keyboard (or touchscreen) allows a user to provide input to the computer

41
Q

storage

A

a disk (or hard drive) stores files and other data

42
Q

RAM

A

RAM (random-access memory) temporarily holds data read from storage

43
Q

operating system

A

allows a user to run other programs and interfaces with the many other peripherals

44
Q

cache memory

A

a small amount of RAM contained on the processors own chip

45
Q

clock

A

governs the rate at which a processor executes instructions

46
Q

Moore’s law

A

the doubling of integrated circuit capacity roughly every 18 months (originally 2 years)