CS1140 Chapter 2: Elementary Programming

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/49

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:55 AM on 9/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

50 Terms

1
New cards

Floating-Point Inaccuracy

Calculations with floating-point numbers can yield inexact results due to representation limits.

2
New cards

Integer Division in Java

Dividing two integers truncates the fractional part, resulting in an integer.

3
New cards

Forcing Floating-Point Division

Make at least one operand a floating-point number (e.g., 2.0 instead of 2).

4
New cards

Redundant Scanner Objects

Creating multiple Scanner instances for System.in is unnecessary and leads to errors.

5
New cards

Redeclaring Variables

No, a variable cannot be redeclared with a different type in the same scope.

6
New cards

Integer Overflow

Occurs when a calculated integer value exceeds its storage type's maximum limit.

7
New cards

Floating-Point Overflow

Yes, floating-point operations can cause overflow, resulting in Infinity.

8
New cards

Runtime Errors from Overflow

No, overflow does not cause a runtime error; it silently wraps around.

9
New cards

Round-Off Error

The difference between the calculated approximation of a number and its exact value.

10
New cards

Integer Round-Off Errors

No, integer operations yield exact results and do not cause round-off errors.

11
New cards

Floating-Point Round-Off Errors

Yes, floating-point operations can cause round-off errors due to binary representation limits.

12
New cards

Algorithm

A step-by-step procedure or formula for solving a problem.

13
New cards

Assignment Operator (=)

Assigns the value on its right to the variable on its left.

14
New cards

Assignment Statement

An executable statement that designates a value for a variable.

15
New cards

byte Type

An 8-bit signed integer primitive data type in Java.

16
New cards

Casting

The process of converting a value from one data type to another.

17
New cards

Constant

An identifier representing permanent data that cannot be changed during execution.

18
New cards

Data Type

A domain of values together with a set of operations on those values.

19
New cards

Declaring Variables

Tells the compiler the variable name and the type of data it holds.

20
New cards

Decrement Operator (--)

Subtracts 1 from a variable.

21
New cards

double Type

A 64-bit double-precision floating-point primitive data type.

22
New cards

Expression

A combination of variables, operators, and values that evaluates to a single value.

23
New cards

final Keyword

A Java modifier used to declare named constants whose values cannot change.

24
New cards

float Type

A 32-bit single-precision floating-point primitive data type.

25
New cards

Floating-Point Number

A number containing a fractional part represented with a decimal point.

26
New cards

Identifier Rules

Must consist of letters, digits, _, or $, and cannot start with a digit.

27
New cards

Increment Operator (++)

Adds 1 to a variable.

28
New cards

Incremental Coding and Testing

Writing and testing code in small, manageable steps to isolate errors easily.

29
New cards

int Type

A 32-bit signed integer primitive data type.

30
New cards

IPO Model

Input, Process, Output — the typical structure of a program execution.

31
New cards

Literal

A constant value appearing directly in a program source code.

32
New cards

long Type

A 64-bit signed integer primitive data type.

33
New cards

Narrowing a Type

Converting a large-range type to a smaller-range type; requires explicit casting.

34
New cards

Operand

A value or variable acted upon by an operator.

35
New cards

Operator

A symbol that performs specific operations on one or more operands.

36
New cards

Postdecrement (var--)

Uses the current value of the variable in the expression, then decrements it.

37
New cards

Predecrement (--var)

Decrements the variable first, then uses its new value in the expression.

38
New cards

Postincrement (var++)

Uses the current value of the variable in the expression, then increments it.

39
New cards

Preincrement (++var)

Increments the variable first, then uses its new value in the expression.

40
New cards

Primitive Data Type

Basic built-in types in Java, such as int, double, float, and byte.

41
New cards

Pseudocode

An informal high-level description of an algorithm using natural language.

42
New cards

Requirements Specification

A formal process that seeks to understand the problem and document requirements.

43
New cards

Scope of a Variable

The part of the program where a variable can be referenced.

44
New cards

short Type

A 16-bit signed integer primitive data type.

45
New cards

Specific Import

Imports a single class explicitly (e.g., import java.util.Scanner;).

46
New cards

Wildcard Import

Imports all classes in a package using an asterisk (e.g., import java.util.*;).

47
New cards

System Analysis

Analyzes data flow and identifies inputs, outputs, and process requirements.

48
New cards

System Design

Designing a system solution, including output formatting, inputs, and algorithmic process.

49
New cards

Underflow

Occurs when a floating-point result is too small to be represented.

50
New cards

UNIX Epoch

Midnight of January 1, 1970 GMT, used as a reference point for time.