Module 1 Flashcards
(27 cards)
Without a program, a computer, even the most powerful one, is nothing more than ?
an object
What actions form a program?
- accept a number representing the distance;
- accept a number representing the travel time;
- divide the former value by the latter and store the result in the memory;
- display the result (representing the average speed) in a readable format.
What is a means (and a tool) for expressing and recording thoughts
a. lanuage
b. machine language
c. instruction list
a. lanuage
A lanuage is a means (and a tool) for expressing and recording thoughts.
Computers have their own language, too, called _________, which is very rudimentary.
a. language
b. machine language
c. instruction list
b. machine language
Machine Language is the computers own language, very rudimentary
machine languages are developed by humans.
A complete set of known commands is called:
a. instruction list (IL)
b. execution list (EX)
c. language
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.
what makes a new language?
a. an alphabet
b. a lexis
c. a syntax
d. a semantics
e. all of the above
e. all of the above
- 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)
- 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)
- 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)
- 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)
A program written in a high-level programming language is called
a. Source code
b. source file
c. machine language
d. natural language
A program written in a high level programming language is called
A. Source code
the file containing the source code is called
a. Source code
b. source file
c. machine language
d. natural language
the file containing the source code is called the SOURCE FILE
b. source file
________ 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
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.
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
- alphabetically – a program needs to be written in a recognizable script, such as Roman, Cyrillic, etc.
- 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;
- syntactically – each language has its rules and they must be obeyed;
- semantically – the program has to make sense.
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;
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;
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.
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.
What does the interpreter actually do?
- have a written program that exists as a computer file
- computer program is actually a piece of text
- source code is usually placed in text files.
- 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.
- The interpreter reads the source code in a way that is common in Western culture: from top to bottom and from left to right
What does the interpreter actually do?
- have a written program that exists as a computer file
- computer program is actually a piece of text
- source code is usually placed in text files.
- 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.
- 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 does the interpreter work?
- First of all, the interpreter checks if all subsequent lines are correct (using the four aspects covered earlier).
- If the interpreter finds an error, it finishes its work immediately. The only result in this case is an error message.
- 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.
- 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 the Interpreter works.
- First of all, the interpreter checks if all subsequent lines are correct (using the four aspects covered earlier).
- If the interpreter finds an error, it finishes its work immediately. The only result in this case is an error message.
- 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.
- 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.
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
compliation advantages
d. all of the above
- the execution of the translated code is usually faster;
- only the user has to have the compiler - the end-user may use the code without it;
- 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.
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
interpretation advantages
c. all the above
- you can run the code as soon as you complete it - there are no additional phases of translation;
- 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.
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
what are disadvantages of compliation?
c. all the above
- the compilation itself may be a very time-consuming process - you may not be able to run your code immediately after making an amendment;
- you have to have as many compilers as hardware platforms you want your code to be run on.
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
what are disadvantages of interpretation?
c. all of the above
- 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;
- both you and the end user have to have the interpreter to run your code.
What are Python 2 rivals?
a. Perl and Ruby
b. Perl and R
c. Ruby and R
a. Perl and Ruby
Pythons 2 rivals
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. 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.
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
b. editor
able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.
what tool launch your newly written code and stop it forcibly when it gets out of control;
a. debugger
b. editor
c. console
c. console
tool launch your newly written code and stop it forcibly when it gets out of control;
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. debugger
tool able to launch your code step-by-step, which will allow you to inspect it at each moment of execution.
IDLE is an acronym: Integrated Development and Learning Environment.
True / False
True
IDLE is an acronym: Integrated Development and Learning Environment.