Variables and data types Flashcards

1
Q

Example languages that run directed on the OS

A

C++, Java, C#, Objective-C

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

Example scripting languages that run through another application

A

ActionScript, Javascript, VBScript

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

actionscript runs on

A

flash

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

javascript runs

A

through browsers

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

VBscript runs

A

on MS office

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

scripting languages are ______ languages

A

interpreted

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

languages that have curly brackets {, } or semi colons ; are languages that influenced by __________ programming

A

C

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

write script for a little popup thats says Hello World

A

alert(“Hello World”);

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

variables are used to ….

A

hold data

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

var year;

variable =

A

year

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

var date;

variable =

A

date

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

THIS ENTIRE COURSE IS BASED ON

A

Javascript!

OTHER LANGUAGES MAY BE DIFFERENT

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

Rules for writing variables

IN JAVASCRIPT

A

1) Can use letters
2) Can use numbers
3) Can use $ (dollar sign)
4) Can use _ (underscore)
5) cannot start variable with a number sign

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

creata a variale that is = 2011

A

var year;

year = 2011;

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

var year;
year = 2011;

shorten this statement

A

var year = 2011;

technically:
year = 2011;

is equivalent to var year = 2011;

because javascript will look for a variable called year and will assume year = 2011; = var year = 2011;

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

are variables case sensitive?

A

YES

17
Q

shorten

var month;
var day;
var year;

A

var month, day, year;

18
Q

variable data types

name a few basics

A

1) integer (whole number: 55, 345, 65465)
2) floating point number (has decimal: 55.33, 5564.3355)
3) single character (a, B, f, g)
4) string( bunch of characters)
5) boolean (true or false)

19
Q

What’s wrong with this?

var phrase = “He said “that’s fine” and left”;

A

Javascript will assume you meant

var phrase = “He said “

and that’s fine” and left”; is separate

20
Q

how to fix

var phrase = “He said “that’s fine” and left”;

A

var phrase = “He said "that’s fine”\ and left”;

use backward slash

21
Q

using variables, write a script to subtract 100 from 200

A
var a = 100;
var b = 200;
var result = b - a;
22
Q

using variables, write a script for 300 divided by 100 decided 8

A
var a = 300;
var b = 200;
var c = 8;
var result = a / b;
var result2 = result/c

or

var a = 300;
var b = 200;
var c = 8;
var result = a / b / c;
23
Q

shorten

score = score + 100;

A

score += 100;

24
Q

shorten

score = score - 48;

A

score -= 48;

25
Q

a++;

is used for

A

an increase of an increment of 1

it is equivalent to a+=1; or a = a+1;

26
Q

++ is called the

A

increment operator

27
Q

– is called the

A

decrement operator

28
Q

does javascript care about whitespace?

A

NO, because of the semi solon ; signals the end of statement

29
Q

what do you write in javascript to cause a line break?

A

\n

30
Q

what do you write to start a comment?

A

//

this only works with 1 line

31
Q

how do you have a multiple line comment?

A

Starts comment > /*

*/