Chapter 1 - What is a Script? Flashcards

1
Q

Writing a Script

A
Define a Goal
Think of this as a puzzle
Design the Script
Split the goal into a series of tasks
Code Each Step
Write each step in JavaScript
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Learning Javascript, we need to understand:

A

Vocabulary
The words that computers understand
Syntax
How to put these word together so the computer can follow them

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

Computers solve problems …….

A

Programmatically

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

A computer, working programmatically, would find the tallest person by…

A

Find the height of the first person
Assume they were the tallest person
Go through the others, comparing their height to the tallest person
If they are taller than the tallest person, they become the tallest person
At the end, you have the tallest person

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

A computer, working programmatically, would find cost of a plaque by…

A

Name is entered into the name field
Script triggered when show cost button is pressed
Script checks a value has been entered
If not, message tells user to enter name
If so, the script will calculate the cost by multiplying the cost per letter by the number of letters
The script displays the cost of the plaque

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

Flowcharts can help to plan tasks using

A

Generic step - Oblong
Event - Lozenge
Input or output - Wonky oblong
Decision - Diamond

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