Answer:
def sum_1k(M):
s = 0
for k in range(1, M+1):
s = s + 1.0/k
return s
def test_sum_1k():
expected_value = 1.0+1.0/2+1.0/3
computed_value = sum_1k(3)
if expected_value == computed_value:
print("Test is successful")
else:
print("Test is NOT successful")
test_sum_1k()
Explanation:
It seems the hidden part is a summation (sigma) notation that goes from 1 to M with 1/k.
- Inside the <em>sum_1k(M)</em>, iterate from 1 to M and calculate-return the sum of the expression.
- Inside the <em>test_sum_1k(),</em> calculate the <em>expected_value,</em> refers to the value that is calculated by hand and <em>computed_value,</em> refers to the value that is the result of the <em>sum_1k(3). </em>Then, compare the values and print the appropriate message
- Call the <em>test_sum_1k()</em> to see the result
Answer:
1GL: Machine language. Represented by a series of 1s and 0s.
2GL: Assembly language. An assembler converts 2GL into machine language.
3GL: High-level programming language. Uses a compiler to convert into machine language.
4GL: Specifically designed for creating database management programs.
5GL: Extremely advanced. Uses statements (scripts) rather than algorithms.
Explanation:
Programming languages started as a series of binary digits (i.e. 0's and 1'). This generation of language is referred to as the first generation.
However, the machine language were difficult to read by human, so mnemonics were created (i.e. assembly language). This language uses symbolic codes such as ADD for addition, etc. This is the second generation
The third generation are the high level languages that uses languages that can be easily understood by human, e.g. + means plus. However, the language must be translated; hence the need for a compiler or interpreter, as the case may be.
The fourth and fifth generations are extensions of the third generation languages. The fourth were created to connect to DBMS while the fifth are more advanced.
Answer:
C) Project and Form
Explanation:
In saving a Visual Basic project properly, the following: two components part that is involved are:
1. Project - this is the project file that will be saved in the computer's memory. On the toolbar of a Visual Basic Editor, there is a "Save Project File" icon, which will be clicked to save a Project file.
2. File - the is the Visual Basic Editor's user interface. Just like "window" in Microsoft Office, it is the space used in writing or building the project file.