chapter 1 Flashcards

1
Q

What is Computer Program

A

Set of instructions that tell pc what to do

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

What is machience language

A

most basic circutry level language

low level programming language

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

What is high level language

A

programming language with reasonable vocab and terms

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

What is syntax

A

A specific set of rules for the language

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

program statement

A

Similar to English sentences

Commands to carry out program tasks

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

Compiler or interpreter

A

Translates language statements into machine code

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

Syntax error

A

Misuse of language rules

A misspelled programming language word

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

Debugging

A

Freeing program of all errors

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

Logic errors

A

Also called semantic errors
Incorrect order or procedure
The program may run but provide inaccurate output

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

Procedural programming

A

Sets of operations executed in sequence

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

Variables

A

Named computer memory locations that hold values

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

Procedures

A

Individual operations grouped into logical units

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

Object-oriented programs

A

Create classes
-Blueprints for an object
Create objects from classes
Create applications

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

what applications is object oriented programming most used for

A

Computer simulations
Graphical user interfaces (GUIs)
-Not all object-oriented programs are written to use a GUI

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

what differs object oriented programming from traditional procedural programming

A

Polymorphism
Inheritance
Encapsulation

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

Class

A

Describes objects with common properties
A definition
An instance

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

Attributes

A
Characteristics that define an object
Differentiate objects of the same class
The value of attributes is an object’s state
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Objects

A

Specific, concrete instances of a class

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

Method

A

A self-contained block of program code that carries out an action
Similar to a procedure

20
Q

Encapsulation

A

Conceals internal values and methods from outside sources
Provides security
Keeps data and methods safe from inadvertent changes

21
Q

Inheritance

A

An important feature of object-oriented programs
Classes share attributes and methods of existing classes but with more specific features
Helps you understand real-world objects

22
Q

Polymorphism

A

Means “many forms”

Allows the same word to be interpreted correctly in different situations based on context

23
Q

Java

A

Developed by Sun Microsystems
An object-oriented language
General-purpose
Advantages
-Security features
-Architecturally neutral
-Can be run on a wide variety of computers
-Does not execute instructions on the computer directly
-Runs on a hypothetical computer known as a Java Virtual Machine (JVM)

24
Q

Source code

A

Programming statements written in high-level programming language

25
Q

Development environment

A

A set of tools used to write programs

26
Q

Bytecode

A

Statements saved in a file

A binary program into which the Java compiler converts source code

27
Q

Java interpreter

A

Checks bytecode and communicates with the operating system

Executes bytecode instructions line by line within the Java Virtual Machine

28
Q

WORA

A

Write once, run anywhere

29
Q

Console applications

A

Support character output

30
Q

Windowed applications

A

Menus
Toolbars
Dialog boxes

31
Q

Literal string

A

Will appear in output exactly as entered

Written between double quotation marks

32
Q

Arguments

A

Pieces of information passed to a method

33
Q

Method

A

Requires information to perform its task

34
Q

System class

A

Refers to the standard output device for a system

35
Q

What are the requirments for class identifiers

A

Must begin with one of the following:

  • Letter of the English alphabet
  • Non-English letter (such as α or π)
  • Underscore
  • Dollar sign
  • Cannot be a digit
  • Cant be a reserved Java word
  • cannot be true, false or null
36
Q

Upper Camel casing (Pascal casing)

A

Each word of an identifier begins with uppercase letter

  • UnderGradStudent
  • InventoryItem
37
Q

Access specifier

A

Defines how a class can be accessed

38
Q

static

A
  • A reserved keyword

- Means the method is accessible and usable even though no objects of the class exist

39
Q

void

A
  • Use in the main() method header
  • Does not indicate the main() method is empty
  • Indicates the main() method does not return a value when called
  • Does not mean that main() doesn’t produce output
40
Q

how does a java class need to be saved

A
  • Save the class in a file with exactly the same name and .java extension
  • For public classes, class name and filename must match exactly
41
Q

compiling a java class

A

Compile the source code into bytecode
Translate the bytecode into executable statements
Using a Java interpreter
Type javac First.java

42
Q

Parsing

A

Compiler divides source code into meaningful portions

43
Q

Logic error

A

The syntax is correct but incorrect results were produced when executed

44
Q

Run-time error

A

Not detected until execution

Often difficult to find and resolve

45
Q

comments

A

non executed statements used for documenting a program or for notes to yourself and or others
Should include author, date, class’ name and its function

46
Q

Java API

A
Also called the Java class library
Provides prewritten information about Java classes