Intro to Java; Info & Math in Java Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

how does software work?

A

u boot the PC & it starts reading instruction from the storage device

the bytes r interpreted as instructions by the PC

the instructions = software –> created thru the process of programming

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

programming

A

giving sequential instructions to a computer system

done using a programming language

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

programming language

A

turned into instructions for a CPU by a compiler

series of rules that u follow to write English-like text representing abstract instructions

Ex: Java

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

compiler

A

a translator from the programming language instructions to the byte instructions used by the CPU

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

programming constructs

A

many programming languages have similar capabilites

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

Integrated Development Environment (IDE)

A

something like BlueJ that combines a text editor with a compiler

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

code

A

the text of a program

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

Java’s naming rules

A

starts with letter

can contain letters, #’s, $, and _

no spaces

case sensitive

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

sample print statement

A

public class CompSci {

public static void main (String [] args)

{

      System.out.println("Hello World!");

}

}

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

whitespace

A

spaces, tabs, etc.

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

values & types

A

Java & all other programming languages have diff types of info

Ex: strings, integers, doubles, and Booleans

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

strings

A

look like text inside of a pair of quotation marks

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

integers

A

same thing as integers in math - whole #’s with no decimal point

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

doubles/floating-point values

A

what we might call real #’s in math - #’s that have a decimal point

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

Booleans

A

only 2 values: true and false

in Java, the words true and false (lowercase) r reserved for Boolean values

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

operators

A

the symbols that we use to perform calculations on diff values

17
Q

arithmetic operators

A

+, -, *, /, %

paranthesis used same as in math

18
Q

concatenation/catting

A

if u “add” anything to a string, it will stick the value onto the string

must be adding

Ex: “Hello” + “werld” = “Hellowerld”

50 + “8” = “508”

“Zoobah” + 0.5 * 3 = “Zoobah1.5”

19
Q

integer division

A

when 2 integers r divided, the result is always an integer

Java will not round - will simply cut off

Ex: 6/4 = 1

2/3 = 0

if either of the values being divided is a double, then Java will do normal division

Ex: 1/5.0 = 0.2

20
Q

Modulus Division

A

only works on integers

gives remainder of 1st # dvided by the 2nd #

Ex: 6%4 = 1R2 = 2

12%3 = 4R0 = 0

If the 1st # is less than the 2nd #, then the answer is always just the 1st #

Ex: 3%4 = 3