Please enable JavaScript to use CodeHS

Mocha Glossary

Flashcards

Course:

Module:

Lesson:

Search:

Hello World General

Traditionally the very first program you write when learning a programming language, a program that prints "Hello world" to the user.

System.out.println Java

Java method that lets us print out a line of output to the user

System.out.print Java

Java method that lets us print output to the user, without ending the line printed.

Double Quotes General

The `"` character

lowerCamelCase General

`lowerCamelCase` is a naming convention where the first letter is lower case, and each subsequent start of a word is upper case.

lowerCamelCase

Variable Java

A symbol or container that holds a value.

int Java

`int` is a Java type that represents an integer (a whole number)

String Java

String is a Java type that represents a string of characters (text)

char Java

`char` is a Java type that represents a single character (a single letter)

boolean Java

`boolean` is a Java type that can either be true or false

double Java

`double` is a Java type that represents a real number with decimal values

Declare a variable Java

Declaring a variable is defining it for the first time.

Initialize a variable Java

Initializing a variable is giving it an initial value, or a starting value.

Assigning to a variable Java

Assigning to a variable is updating the variable's value

Type Java

The type of a variable defines what kinds of values the variable can hold

Variable General

A symbol or container that holds a value.

variable

readLine Java

Java method that lets us read in a line of input from the user as a String

readInt Java

Java method that lets us read in an integer input from the user

readDouble Java

Java method that lets us read in a decimal value input from the user

readBoolean Java

Java method that lets us read in a true or false value input from the user

Scanner class Java

A class within java.util. It contains code specifically designed to help with user input.

Variables and Data Types General

Understanding how data is stored and manipulated in programs.

User Input General

Data provided by the user to a program via input commands.

Parentheses General

( and )

Parentheses

Increment General

To add to or increase

Increment

Decrement General

To subtract from or decrease

decrement

Modulus operator General

The modulus operator (written as % in most programming languages) divides two numbers and returns the remainder.

Integer Division General

When two integers are divided, the decimal values are truncated, or chopped off.

integer overflow General

When a value higher than the maximum or lower than the minimum is used which can result in logic errors.

Arithmetic Expression General

A combination of numbers, operators, and sometimes variables that computes a value.

Round-Off Error General

The difference between the calculated approximation of a number and its exact mathematical value due to rounding.

Casting Java

Casting is turning something of one type into another type

Implicit Casting Java

When Java automatically casts the value correctly without the programmer needing to do so

Type Casting Java

The process of converting one data type into another.

Explicit Casting Java

Manually converting a larger data type to a smaller one using casting syntax.

Rounding Java

Reducing the number of decimal places in a number, sometimes involving casting.

Conditional Statement General

A statement that evaluates to true or false.

Negate General

To flip a boolean value, or take the opposite of a boolean value. If you negate true, you get false. If you negate false, you get true.

And operator Java

Logical operator that ANDs two boolean values. Written as `&&`. `a && b` will be true if both `a` and `b` are true.

Or operator Java

Logical operator that ORs two boolean values. Written as `||`. `a || b` will be true if `a` or `b` is true.

Not operator Java

Logical operator that negates a single boolean value. Written as `!`. `!a` will be true if `a` is false, and false if `a` is true.

Logical Operator Java

Used to make logical associations between boolean values.

Short Circuit Evaluation Java

When the result of a logical expression using && or || can be determined by evaluating only the first Boolean operand, the second is not evaluated.

Toggle General

To switch between two states, such as turning a light on and off

Compound Boolean Expression Java

A Boolean expression that combines two or more conditions using logical operators

Condition General

A condition is code that you put inside an if statement or while-loop.

Condition

Comparison operator General

Used to make comparisons between values.

comparison operator

Logical AND (`&&`) General

A logical operator that returns true if both conditions are true

Logical OR (`||`) JavaScript

A logical operator that returns true if at least one condition is true

Logical NOT (`!`) General

A logical operator that negates a Boolean value, turning true into false and vice versa

Conditional Statement General

A programming construct that executes code based on whether a condition is true or false

Loop General

A loop is a way to repeat code in your program.

Loop

Iterate General

A single run through the instructions contained a loop

Iterate

For Loop Java

A for loop lets us repeat code a **fixed number of times**.

Counter Java

A variable used to count the number of times an action has been performed.

DRY Principle Java

Otherwise known as Don’t Repeat Yourself, this principle is designed to help eliminate repeated code and reduce the complexity of a solution

Loop Control Variables Java

Variables used to control the execution of the loop, typically defining the start, end, and step of the loop

While Loop General

Lets us repeat code as long as something is true.

While Loop

Control Structure General

A control structure lets us change the flow of the code.

Control Structure loops if statements

Edge Case General

An edge case is a problem in your code that only occurs in extreme situations.

Edge Case

Fencepost Problem General

A problem when using a while loop where you forget one action at the beginning or the end.

Fencepost Problem

Infinite Loop General

A loop that has no way of stopping, and will keep looping forever.

If Statement General

An if statement lets you ask a question to the program and only run code if the answer is true.

If Statement

If Else Statement General

Control structure that lets us run either one section of code or another depending on a test.

If Else Statement

Curly Bracket General

An open curly bracket is { and a close curly bracket is }

Curly Bracket

Indentation General

Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.

Nested if Statements Java

The process of placing if statements within if statements.

String Comparison Java

The process of checking if two strings are equal using `.equals()` or `.equalsIgnoreCase()`

Object Java

An object is a single instance of a Java class. An object has both state and behavior.

Primitive Type Java

Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)

Concatenation Java

Concatenation is another word for combining. Concatenating Strings is when we add Strings together.

.equals() method Java

A method used in Java to compare the contents of two Strings for equality

Method Java

A method is a way to teach the computer a new command

Loop-and-a-half Java

A loop, most often set with `while(true)`, that has a `break` statement in the loop body.

Short Circuit Evaluation General

A short cut when evaluating boolean expressions. If the result can be determined solely by the first part of a boolean expression, the second part is not evaluated, it is skipped.

De Morgan's Laws Java

Laws that define how we can negate an AND statement and how we can negate an OR statement

Sentinel Java

A constant that has the specific purpose of being the value that breaks out of a loop.

break statement Java

The `break;` statement breaks out of the current loop, without executing any more code in the loop.