Module 1 Flashcards

(27 cards)

1
Q

Without a program, a computer, even the most powerful one, is nothing more than ?

A

an object

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

What actions form a program?

A
  1. accept a number representing the distance;
  2. accept a number representing the travel time;
  3. divide the former value by the latter and store the result in the memory;
  4. display the result (representing the average speed) in a readable format.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a means (and a tool) for expressing and recording thoughts

a. lanuage
b. machine language
c. instruction list

A

a. lanuage

A lanuage is a means (and a tool) for expressing and recording thoughts.

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

Computers have their own language, too, called _________, which is very rudimentary.

a. language
b. machine language
c. instruction list

A

b. machine language

Machine Language is the computers own language, very rudimentary

machine languages are developed by humans.

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

A complete set of known commands is called:

a. instruction list (IL)
b. execution list (EX)
c. language

A

a. (IL) Instruction List

(IL) is a complete set of known commands

The IL is, in fact, the alphabet of a machine language. This is the simplest and most primary set of symbols we can use to give commands to a computer. It’s the computer’s mother tongue.

Different types of computers may vary depending on the size of their ILs, and the instructions could be completely different in different models.

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

what makes a new language?

a. an alphabet
b. a lexis
c. a syntax
d. a semantics
e. all of the above

A

e. all of the above

  1. an alphabet: a set of symbols used to build words of a certain language (e.g., the Latin alphabet for English, the Cyrillic alphabet for Russian, Kanji for Japanese, and so on)
  2. a lexis: (aka a dictionary) a set of words the language offers its users (e.g., the word “computer” comes from the English language dictionary, while “cmoptrue” doesn’t; the word “chat” is present both in English and French dictionaries, but their meanings are different)
  3. a syntax: a set of rules (formal or informal, written or felt intuitively) used to determine if a certain string of words forms a valid sentence (e.g., “I am a python” is a syntactically correct phrase, while “I a python am” isn’t)
  4. semantics: a set of rules determining if a certain phrase makes sense (e.g., “I ate a doughnut” makes sense, but “A doughnut ate me” doesn’t)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A program written in a high-level programming language is called

a. Source code
b. source file
c. machine language
d. natural language

A

A program written in a high level programming language is called

A. Source code

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

the file containing the source code is called

a. Source code
b. source file
c. machine language
d. natural language

A

the file containing the source code is called the SOURCE FILE

b. source file

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

________ is the act of composing the selected programming language’s elements in the order that will cause the desired effect.

a. Computer sourcing
b. Computer programming
c. Machine sourcing

A

b. Computer programming

Computer programming is the act of composing the selected programming language’s elements in the order that will cause the desired effect.

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

What are the 4 different ways of Composition?

a. alphabetically, lexically, syntactically, and semantically

b. alphabetically, lexically, semantically, deep learning

c. alphabetically, machine learning, neural networks, deep learning

A
  1. alphabetically – a program needs to be written in a recognizable script, such as Roman, Cyrillic, etc.
  2. lexically – each programming language has its dictionary and you need to master it; thankfully, it’s much simpler and smaller than the dictionary of any natural language;
  3. syntactically – each language has its rules and they must be obeyed;
  4. semantically – the program has to make sense.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is this COMPLIATION or INTERPRETATION?

the source program is translated once (however, this act must be repeated each time you modify the source code) by getting a file (e.g., an .exe file if the code is intended to be run under MS Windows) containing the machine code; now you can distribute the file worldwide; the program that performs this translation is called a compiler or translator;

A

COMPLIATION

the source program is translated once (however, this act must be repeated each time you modify the source code) by getting a file (e.g., an .exe file if the code is intended to be run under MS Windows) containing the machine code; now you can distribute the file worldwide; the program that performs this translation is called a compiler or translator;

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

Is this COMPLIATION or INTERPRETATION?

you (or any user of the code) can translate the source program each time it has to be run; the program performing this kind of transformation is called an interpreter, as it interprets the code every time it is intended to be executed; it also means that you cannot just distribute the source code as-is, because the end-user also needs the interpreter to execute it.

A

INTERPRETATION

you (or any user of the code) can translate the source program each time it has to be run; the program performing this kind of transformation is called an interpreter, as it interprets the code every time it is intended to be executed; it also means that you cannot just distribute the source code as-is, because the end-user also needs the interpreter to execute it.

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

What does the interpreter actually do?

  1. have a written program that exists as a computer file
  2. computer program is actually a piece of text
  3. source code is usually placed in text files.
  4. Note: it has to be pure text, without any decorations like different fonts, colors, embedded images or other media. Now you have to invoke the interpreter and let it read your source file.
  5. The interpreter reads the source code in a way that is common in Western culture: from top to bottom and from left to right
A

What does the interpreter actually do?

  1. have a written program that exists as a computer file
  2. computer program is actually a piece of text
  3. source code is usually placed in text files.
  4. Note: it has to be pure text, without any decorations like different fonts, colors, embedded images or other media. Now you have to invoke the interpreter and let it read your source file.
  5. The interpreter reads the source code in a way that is common in Western culture: from top to bottom and from left to right`
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does the interpreter work?

  1. First of all, the interpreter checks if all subsequent lines are correct (using the four aspects covered earlier).
  2. If the interpreter finds an error, it finishes its work immediately. The only result in this case is an error message.
  3. The interpreter will inform you where the error is located and what caused it. However, these messages may be misleading, as the interpreter isn’t able to follow your exact intentions, and may detect errors at some distance from their real causes.
  4. In other words, the actual reason is usually located a little earlier in the code, for example, in the place where you had to inform the interpreter that you were going to use the entity of the name.
A

How the Interpreter works.

  1. First of all, the interpreter checks if all subsequent lines are correct (using the four aspects covered earlier).
  2. If the interpreter finds an error, it finishes its work immediately. The only result in this case is an error message.
  3. The interpreter will inform you where the error is located and what caused it. However, these messages may be misleading, as the interpreter isn’t able to follow your exact intentions, and may detect errors at some distance from their real causes.
  4. In other words, the actual reason is usually located a little earlier in the code, for example, in the place where you had to inform the interpreter that you were going to use the entity of the name.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are compliation advantages?

a. the execution of the translated code is usually faster;

b. only the user has to have the compiler - the end-user may use the code without it;

c. the translated code is stored using machine language - as it is very hard to understand it, your own inventions and programming tricks are likely to remain your secret.

d. all the above

A

compliation advantages

d. all of the above

  1. the execution of the translated code is usually faster;
  2. only the user has to have the compiler - the end-user may use the code without it;
  3. the translated code is stored using machine language - as it is very hard to understand it, your own inventions and programming tricks are likely to remain your secret.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Interpretation advantages

a. you can run the code as soon as you complete it - there are no additional phases of translation;

b. the code is stored using programming language, not machine language - this means that it can be run on computers using different machine languages; you don’t compile your code separately for each different architecture.

c. all the above

A

interpretation advantages

c. all the above

  1. you can run the code as soon as you complete it - there are no additional phases of translation;
  2. the code is stored using programming language, not machine language - this means that it can be run on computers using different machine languages; you don’t compile your code separately for each different architecture.
17
Q

what are disadvantages of compliation?

a. the compilation itself may be a very time-consuming process - you may not be able to run your code immediately after making an amendment;

b. you have to have as many compilers as hardware platforms you want your code to be run on.

c. all the above

A

what are disadvantages of compliation?

c. all the above

  1. the compilation itself may be a very time-consuming process - you may not be able to run your code immediately after making an amendment;
  2. you have to have as many compilers as hardware platforms you want your code to be run on.
18
Q

what are disadvantages of interpretation?

a. don’t expect interpretation to ramp up your code to high speed - your code will share the computer’s power with the interpreter, so it can’t be really fast;

b. both you and the end user have to have the interpreter to run your code.

c. all of the above

A

what are disadvantages of interpretation?

c. all of the above

  1. don’t expect interpretation to ramp up your code to high speed - your code will share the computer’s power with the interpreter, so it can’t be really fast;
  2. both you and the end user have to have the interpreter to run your code.
19
Q

What are Python 2 rivals?

a. Perl and Ruby
b. Perl and R
c. Ruby and R

A

a. Perl and Ruby

Pythons 2 rivals

20
Q

what program is the following
Large and complex mathematical calculations may be easily coded in Python (much easier than in “C” or any other traditional language), but the resulting code execution may be extremely time-consuming.

a. cython
b. python
c. c++

A

a. cython

Large and complex mathematical calculations may be easily coded in Python (much easier than in “C” or any other traditional language), but the resulting code execution may be extremely time-consuming.

21
Q

what tool able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.

a. debugger
b. editor
c. console

A

b. editor

able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.

22
Q

what tool launch your newly written code and stop it forcibly when it gets out of control;

a. debugger
b. editor
c. console

A

c. console

tool launch your newly written code and stop it forcibly when it gets out of control;

23
Q

what tool able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.

a. debugger
b. editor
c. console

A

a. debugger

tool able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.

24
Q

IDLE is an acronym: Integrated Development and Learning Environment.

True / False

A

True
IDLE is an acronym: Integrated Development and Learning Environment.

25
(which is the path that the code traverses through different parts of the program - you can ignore it for now, as it is empty in such a simple code); a. traceback b. location of error c. content of erroneous line d. name of error
a. traceback (which is the path that the code traverses through different parts of the program - you can ignore it for now, as it is empty in such a simple code);
26
What is the name of the file containing the error, line number and module name); note: the number may be misleading, as Python usually shows the place where it first notices the effects of the error, not necessarily the error itself; a. traceback b. location of error c. content of erroneous line d. name of error
b. location of error the name of the file containing the error, line number and module name); note: the number may be misleading, as Python usually shows the place where it first notices the effects of the error, not necessarily the error itself;
27