Mathematical Functions, Characters, and Strings

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

1/45

flashcard set

Earn XP

Description and Tags

This flashcard set covers the essentials of Java's Math class, character handling, String object methods, and output formatting as presented in CSC110 AB.

Last updated 7:29 AM on 5/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

46 Terms

1
New cards

Sequence\text{Sequence}

A control structure where statements execute one after another from top to bottom.

2
New cards

Selection\text{Selection}

A control structure where a decision is made based on a boolean condition.

3
New cards

====

The comparison operator used to check for equality in a condition.

4
New cards

==

The assignment operator used to set the value of a variable.

5
New cards

Fall-through\text{Fall-through}

A situation in a switch statement where forgetting a break causes all cases below the match to execute.

6
New cards

&&\&\&

The AND boolean operator which is true only if both conditions are true.

7
New cards

||

The OR boolean operator which is true if at least one condition is true.

8
New cards

!!

The NOT boolean operator which flips the boolean value.

9
New cards

Math Class\text{Math Class}

A built-in Java toolkit that provides static methods for common mathematical operations and requires no import.

10
New cards

Math.abs(x)\text{Math.abs(x)}

Returns the absolute value or distance from zero for the provided number.

11
New cards

Math.pow(base, exponent)\text{Math.pow(base, exponent)}

Returns the value of the base raised to the power of the exponent as a double.

12
New cards

Math.sqrt(x)\text{Math.sqrt(x)}

Returns the square root of the specified value.

13
New cards

Math.ceil(x)\text{Math.ceil(x)}

Rounds a decimal number UP to the nearest whole number.

14
New cards

Math.floor(x)\text{Math.floor(x)}

Rounds a decimal number DOWN to the nearest whole number.

15
New cards

Math.round(x)\text{Math.round(x)}

Rounds a number to the nearest whole number integer.

16
New cards

Math.random()\text{Math.random()}

Returns a pseudo-random double value in the range [0.0, 1.0).

17
New cards

Random Integer Formula\text{Random Integer Formula}

The expression (int)(Math.random() * range) + min\text{(int)(Math.random() * range) + min} where range is max - min + 1\text{max - min + 1}; used to generate integers within a specific inclusive range.

18
New cards

Pseudo-random Numbers\text{Pseudo-random Numbers}

Numbers generated by deterministic algorithms that are predictable if the starting seed is known.

19
New cards

Seed\text{Seed}

An initial value that determines the entire sequence of numbers generated by a random number generator.

20
New cards

Math.PI\text{Math.PI}

A built-in constant representing the ratio of a circle's circumference to its diameter, approximately 3.1415926535897933.141592653589793.

21
New cards

char\text{char}

A primitive type that stores a single character wrapped in single quotes, such as ’A’\text{'A'}.

22
New cards

Unicode\text{Unicode}

A universal encodings system used by Java that assigns a unique number to every character in every language.

23
New cards

ASCII\text{ASCII}

The first 128 characters of the Unicode set, including standard English letters and numbers.

24
New cards

\text{\n}

The escape sequence for a new line.

25
New cards

\text{\t}

The escape sequence for a horizontal tab.

26
New cards

\text{\"}

The escape sequence for a double quote.

27
New cards

\text{\}

The escape sequence for a backslash.

28
New cards

Character.isDigit(c)\text{Character.isDigit(c)}

A static method that returns true if the specified character is a digit.

29
New cards

Character.isLetter(c)\text{Character.isLetter(c)}

A static method that returns true if the specified character is a letter.

30
New cards

Object\text{Object}

A variable that has both data (information) and behaviors (methods), stored as a reference to a memory address.

31
New cards

String\text{String}

An object type in Java that stores a sequence of characters wrapped in double quotes.

32
New cards

length()\text{length()}

A String method that returns the number of characters in the string, including spaces and punctuation.

33
New cards

charAt(i)\text{charAt(i)}

A String method that returns the character at the specific index ii, where the first character is at index 00.

34
New cards

Concatenation\text{Concatenation}

The process of joining strings together using the ++ operator.

35
New cards

trim()\text{trim()}

A String method that removes leading and trailing spaces from a string.

36
New cards

next()\text{next()}

A Scanner method that reads one word and stops at a space or Enter key.

37
New cards

nextLine()\text{nextLine()}

A Scanner method that reads the entire line, including spaces, and stops only at the Enter key.

38
New cards

equals()\text{equals()}

The method used to compare the content of two strings for an exact, case-sensitive match.

39
New cards

compareTo()\text{compareTo()}

A method that returns 00 if strings are equal, a negative value if the string comes before another alphabetically, or a positive value if it comes after.

40
New cards

substring(start, end)\text{substring(start, end)}

Extracts a portion of a string from the start index up to, but not including, the end index.

41
New cards

indexOf()\text{indexOf()}

Searches for a character or substring and returns its position, or 1-1 if not found.

42
New cards

printf\text{printf}

A method used for formatted output, providing precise control over alignment, decimal places, and columns.

43
New cards

%d\%d

A printf format specifier used for integers.

44
New cards

%s\%s

A printf format specifier used for strings.

45
New cards

%.2f\%.2f

A printf format specifier used to display a decimal number with two decimal places.

46
New cards

Text Block\text{Text Block}

A multi-line string starting and ending with triple quotes (""")("""), introduced in Java 15+ to preserve formatting without escape sequences.