CS Awesome - Unit 1 Vocabulary

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

Variable

A name associated with a memory location in the computer.

2
New cards

object variable

Holds a reference which points to the object in memory.

3
New cards

boolean

used to declare a variable that can only have the value true or false.

4
New cards

double

used to declare a variable that is a decimal number like 3.25.

5
New cards

int

used to declare a variable of type integer (a whole number like -3 or 235).

6
New cards

static

means that the field or method exists in the object that defines the class.

7
New cards

compiler

Software that translates the Java source code into the Java class file that can be run.

8
New cards

compiler/syntax error

An error or bug that is found by the compiler like a missing semicolon

9
New cards

logic error

error that has correct syntax but undesired output by the programmer

10
New cards

Class

  • used to define a type of objects (classify something)

  • creates Objects that do the actual work in object-oriented programming.

  • Defines attributes of the object

  • Allows for actions to be taken

11
New cards

attribute

data/properties of a class

12
New cards

method

type (class) with abilities/behaviors

13
New cards

Main Method

  • Where execution starts in a Java program.

  • used to test the class

14
New cards

constructor

  • ways to initialize fields that have the same names as a class

  • many constructors can be used for the same object

15
New cards

Boolean

An expression that is either true or false.

16
New cards

Camel Case

One way to create a variable name by appending several words together and uppercasing the first letter of each word after the first word (myScore).

17
New cards

Casting

  • Changing the type of a variable using (type) name.

  • i.e. rounding

    • Positive numbers: (int)(x + .5)

    • Negative number: (int)(x - .5)

18
New cards

System.out.println()

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

19
New cards

Declare a Variable

Specifying the type and name for a variable. This sets aside memory for a variable of that type and associates the name with that memory location.

20
New cards

Initializing a Variable

The first time you set the value of a variable.

21
New cards

String literal

Text enclosed by double quotes.

22
New cards

modulo

The % operator which returns the remainder from one number divide by another.

23
New cards

Operator

Common mathematical symbols such as + for addition and * for multiplication.

24
New cards

Shortcut or compound assignment operators

Operators like x++ or x+= 1 which mean x = x + 1

25
New cards

assignment statements

  • initialize or change the value stored in a variable using the assignment operator =.

  • always has a single variable on the lefthand side

26
New cards

data type

determines the size of memory reserved for a variable, for example int, double, boolean, String.

27
New cards

ArithmeticException

If you divide by zero, you will get this error.

28
New cards

operator precedence

Some operators are done before others, for example *, /, % have precedence over + and -, unless parentheses are used.

29
New cards

arithmetic expression

a sequence of operands and operators that describe a calculation to be performed, for example 3*(2 + x)

30
New cards

increment operator

The operator (++) that increases the value of a numerical variable by one.

31
New cards

string literal

characters inside the quotation marks: “”

32
New cards

delimiter

  • open and close curly braces that indicate to java to start and close a line

  • {} are used to surround blocks of code such as methods or the contents of classes

  • () are used in mathematical expressions and to surround parameter lists for method calls

  • [] they are used for arrays (lists)

33
New cards

integer division

  • arithmetic operation that uses two int values to evaluate to an int value (no decimal)

  • i.e. ¾ = 0

34
New cards

System.out.println( String.format("%.02f", number) );

Decimal output formatted to only show 2 decimal places

35
New cards

postfix operator

  • operator after the variable name

  • value of the variable is changed after evaluating the variable to get its value.

36
New cards

prefix operator

  • operator before the variable name

  • value of the variable in incremented before the variable is evaluated to get the value of the expression