Java Terms Flashcards

(18 cards)

1
Q

confirm()

A

user must respond to questions (cancel or ok)

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

prompt

A

user must type an answer

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

strings

A

a string of letters or number between quotations (“Michael”)

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

.length

A

after a string, this command will tell you the length of the string

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

boolean

A

a code that is either ‘true’ or ‘false’

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

console.log()

A

printing out, will take whatever is in the () and log it to the console

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

if statement

A

if the condition is true, the code in the { } will run

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

if { } else { }

A

If the condition is true: run code, else (otherwise): run this code instead

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

modulo %

A

The computer will divide the numbers between the modulo % and return the remainder.

For example: 23 % 10 = 3

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

.substring(x,y)

A

logs the string between the two given points (x,y)

For Example: “Hello”.substring(0,2)

Logs: “He”

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

var myAge = 35

A

you can declare a variable to be called up anytime

variables can be changed in the algorithm

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

var myCountry = “USA”

console. log(myCountry.length);
console. log(myCountry.substring(0,4));

A

This would print out the following:

3

USA

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

comparisons

A

=>

<=

===

<

>

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

var someName = function (something)

{};

A

creates a variable (someName)

and an input for the function (parameter)

{input and code to run};

(must end with a semi colon ;)

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

parameter

A

the placehoder in a function for an input

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

sayHello(“Michael”)

A

Calling a function requires the variable associated with the function as well as the paramerter input.

17
Q

return (an output of a function)

A

you can return a number inside a function which will be used in another line of code as in:

var someNumber = fucntion(number)

{return number *8};

var newNumber = someNumber(9)

console.log (newNumber)

18
Q

for loops

A

for (i = x; i < x; i++)

increment up by 1 i++

increment down by 1 i–

increment up by any value +=

increment down by any value -=