ALGORITHMS
TEST
1. The algorithm is
1. rules for performing certain actions;
2. a directed graph indicating the order of execution of a certain set of commands;
3. description of the sequence of actions, the strict execution of which leads to
4. a set of commands for a computer;
5. computer network protocol.
solving a given problem in a finite number of steps;
2. An algorithm is called linear if
the same actions;



3. An algorithm is called cyclic if
the same actions;
1. it is designed in such a way that its implementation involves multiple repetitions of the same
2. the course of its implementation depends on the truth of certain conditions;
3. his commands are executed in the order of their natural sequence one after another
regardless of any conditions;
4. it can be presented in tabular form;
5. It includes a helper algorithm.
4. The algorithm includes branching if
the same actions;
1. it is designed in such a way that its implementation involves multiple repetitions of the same
2. the course of its implementation depends on the truth of certain conditions;
3. his commands are executed in the order of their natural sequence one after another
regardless of any conditions;
4. it can be presented in tabular form;
5. It includes a helper algorithm.
5. The property of the algorithm is:
1. effectiveness;
2. cyclicality;
3. the ability to change the sequence of command execution;
4. the ability to execute the algorithm in reverse order;
5. ease of writing in programming languages.
6. The property of an algorithm is that each action and the algorithm as a whole
must be able to complete, called
1. discreteness;
2. determinism;
3. limb;
4. mass participation;
5. effectiveness.
7. The property of an algorithm is that the algorithm must consist of specific
actions following in a certain order are called

Kolpashnikova I.A. Teacher at OGOI NPO “PU No. 35”
1. discreteness;
2. determinism;
3. limb;
4. mass participation;
5. effectiveness.
8. The property of the algorithm is that there are no errors; the algorithm should lead to
the correct result for all valid input values ​​is called
1. discreteness;
2. determinism;
3. limb;
4. mass participation;
5. effectiveness.
9. The property of an algorithm is that the same algorithm can be used
with different initial data is called
1. discreteness;
2. determinism;
3. limb;
4. mass participation;
5. effectiveness.
10. The property of the algorithm is that any action must be strictly and
unambiguously defined in each case is called
1. discreteness;
2. determinism;
3. limb;
4. mass participation;
5. effectiveness.
11. Choose the correct representation of the arithmetic expression
language:
on an algorithmic
1. x + 3y / 5xy
2. x + 3*y / 5*x*y
3.
(x + 3y) / 5xy
4.
(x + 3*y) / (5*x*y)
5. x + 3*y / (5*x*y)
12. An algorithm written in a computer-friendly programming language is called
1. executor of algorithms;
2. program;
3. listing;
4. text;
5. algorithm protocol.

KEY
1
2
3
4
5
6
7
8

1. The algorithm is:

1) instructions to perform actions+

2) the process of performing calculations leading to the solution of the problem. –

3) a system of rules that describes the sequence of actions that must be performed to solve a problem

2. The properties of the algorithm are:

1) information content

2) mass participation+

3) efficiency

4) certainty+

5) discreteness+

6) cyclicality

7) effectiveness.+

3. The algorithm can be specified in the following ways:

1) verbal+

2) in algorithmic language+

3) graphic+

4) formal-verbal +

5) verbal-graphic

6) sequence of bytes.

4. The program is:

1) a system of rules that describes the sequence of actions that must be performed to solve a problem

2) an indication of performing actions from a given set

3) external memory area for storing text, numeric data and other information

4) a sequence of commands that implements the algorithm for solving the problem.+

5. The interpreter program performs:

1) search for files on disk

2) statement-by-statement execution of the program+

3) complete execution of the program.

6. The compiler program performs:

1) translates the source text into machine code

2) writes machine code in the form of a boot file.+

3) generates a text file

7. QBASIC is

1) an algorithmic language using MS-DOS commands

2) algorithmic programming language operating in interpretation mode

3) an algorithmic language that works only in the Windows environment.+

8. The QBASIC language alphabet includes:

1) letters of the Latin alphabet+

2) letters of the Greek alphabet

3) letters of the Russian alphabet

5) signs of arithmetic operations: +, -, /, “+

6) signs of relational operations: >,<, =, >=, <=, <>+

7) special characters:!,?, #, %,&, $,«,«,.,+

8) parentheses () and) square brackets.+

9. The following data types exist in QBASIC:

1) numeric+

2) text+

3) pointers

4) data types

5) records.

10. Numerical data can be represented as:

2) fixed point+

3) in the form of strings

4) floating point+

11. Select correctly represented numeric data in QBASIC:

1) +B, -14, 21.5E2, 0.05+

2) 3.4*E8, 45.E2, -16

3) 18.2, .05E1, -18+

4) 0.05E5, ±16, -21.5

5) 21-У2, -18, 45.2

12. Writing a number in floating point form is exponential notation:

2) not true.

13. If a data type carries textual information, it must be enclosed in quotation marks:

2) not true.

14. Arithmetic expressions consist of:

2) constants+

3) MS-DOS commands

4) machine commands

5) variables+

6) functions+

7) parentheses+

8) square brackets.

15. A variable is:

1) service word in QBASIC language

2) a memory area in which a certain value is stored +

3) register value.

16. The variable name is:

1) any sequence of any characters

2) a sequence of Latin letters, numbers, special characters (except spaces)+

3) , which must always begin with a Latin letter

4) a sequence of Russian, Latin letters starting with a Latin letter and special characters, allowing an underscore.

17. To denote string variables:

1) next to the name on the left there is a $ sign

2) next to the name on the right there is a $+ sign

3) the variable name is written in quotes.

18. To denote integer variables:

1) next to the name on the left there is a % sign

2) next to the name on the left there is a # sign

3) next to the name on the right there is a % sign.+

19. To denote real variables with double precision:

1) next to the name on the left there is a # sign

2) next to the name on the right there is a #+ sign

3) ## signs are placed next to the name on the right.

20. Is the statement true? The spelling of names is allowed as lowercase (small)

1) and capital letters (large)

2) letters and QBASIC does not differentiate between them.

Option 1

    The algorithm is:

    1. computer network protocol;

      rules for performing certain actions;

      description of a sequence of actions, the strict execution of which leads to the solution of the task in a finite number of steps;

      a directed graph indicating the order in which a certain set of commands is executed;

      a set of commands for a computer.

    The algorithm includes branching if:

    1. it can be presented in tabular form;

      the progress of its implementation depends on the truth of certain conditions;

      it includes a helper algorithm.

    The property of an algorithm that there are no errors (the algorithm must lead to the correct result for all valid input values) is called:

    1. Mass character;

      Limb;

      Discreteness;

      Efficiency;

      Determinism;

    The property of an algorithm that the same algorithm can be used with different initial data is called:

    1. determinism

      mass character

      limb

      discreteness

      effectiveness

    Which program structure is correct? List and explain the errors found:

Begin

program MyFirst;

X:=Y+195;

end.

program MyProg;

begin

Writeln('Hello');

end.

    What value will the variable X take after executing the program fragment? Write down the solution and answer:

f:=17;

d:=5;
If f>=d then x:=f else x:=d

A) 5; B) 12; AT 2; D) 17

a:= 6*12 + 3;

b:= a div 10 + 5;

a:= b mod 10 + 1;

c:= a*a + b*b – a / 2 * b;

    What will the value of A be equal to after executing the algorithm (Fig. 1). Write down the solution and answer. Fig.1

    Determine what will be printed as a result of the following program fragment. Write down the solution and answer:

var k, s: integer;

begin

s:=0;

k:=1;

while k< 11 do begin

s:=s+k;

k:=k+1;

end;

write(s);

end.

    Make a block diagram, write a program in Pascal. Tasks:

    1. An integer is given. If it is positive, then add 1 to it; otherwise, subtract 2 from it. Print the resulting number.

      Find the sum of positive numbers in an array X consisting of N elements.

Final test on the topic

"Fundamentals of Algorithmization". 9th grade.

Option 2

    An algorithm written in a computer-friendly programming language is called:

    1. listing;

      algorithm executor;

      algorithm protocol;

      program;

      text.

    An algorithm is called cyclic if:

    1. his commands are executed in the order of their natural succession, regardless of any conditions;

      it is designed in such a way that its implementation involves repeated repetition of the same actions;

      the progress of its implementation depends on the truth of certain conditions

      it includes a helper algorithm;

      it can be presented in tabular form.

    The property of an algorithm that each action and the algorithm as a whole must be able to be completed is called:

    1. Discreteness;

      Limb;

      Efficiency;

      Determinism;

      Mass character.

    The property of an algorithm, that the algorithm must consist of specific actions following in a certain order, is called:

    1. Discreteness;

      Mass character;

      Limb;

      Efficiency;

      Determinism;

    Find errors in operator records:

a) Write ©;

b) Writeln;

c) Writeln (Enter any number);

d) Write X,Y;

e) WRITELN (‘Sunday, non-working day’);

    What value will the variable X take after executing the program fragment? Write down the solution and answer:

f:=5;

d:=7;
If f>=dthen x:=felse x:=d

a) 5; b) 6; c) 7; d) 1

x:= 8 + 2*5;

:= (x mod 10) + 14;

x:= (y div 10) + 3;

c:= x - y;

    What will the value of S be equal to after executing the algorithm (Fig. 1). Write down the solution and answer. Fig.1

    Determine what will be printed as a result of the following program fragment. Write down the solution and answer

var k, s: integer;

begin

s:=0;

k:=0;

while k< 30 do begin

k:=k+3;

s:=s+k;

end;

write(s);

end.

    Make a flowchart, write a program in the language. Tasks:

    1. Two numbers are given. Output the largest of them.

      Find the maximum number of an array X consisting of N elements.

Answers to the complete test on the topic

"Fundamentals of Algorithmization". 9th grade.

Option 1

Job number

Answer

Solution

No

No

No

No

Option “a” is incorrect because the program structure consists of: a title, a block of descriptions, a function word “begin”, a block of statements and a service word “end”.

The title is written first according to the following rule: first the service word “program” followed by a space, the name of the program and the sign “;”.

There is an error in option “a” in the first two lines. They need to be swapped: the name of the program in first place, the service word “begin” in second place.

Therefore, the correct entry for answer option “a” is:

program MyFirst;

Begin

X:=Y+195;

end.

Given two variables f =17 and d =5. The algorithmic construction “branching” calculates the value of the variable x according to a condition. Condition (f >=d) TRUE, because 17>5. Therefore, we perform the actions after the service word “then” and before “else”, namely x :=f. We get that x =17

Team

A = 6 * 12 + 3 = 75

b = a div 10 +5 = 75 div 10 + 5 = 7 + 5 = 12

a = b mod 10 + 1 = 12 mod 10 + 1 = 2 + 1 = 3

c = a * a + b * b – a / 2 * b = 3 * 3 + 12 * 12 – 3 / 2 * 12 =

9 + 144 – 1,5 * 12 = 153 – 18 = 135

A = 2

    I = 2, A = A + 1 = 2 + 1 = 3

    I = 3, A = A + 1 = 3 + 1 = 4

    I = 4, A = A + 1 = 4 + 1 = 5

s=0, k=1

The "bye" cycle. While k<11 выполнять тело цикла. Цикл повторится 10 раз:

    k = 1, s= s + k = 0 + 1 = 1, k= k + 1 = 1 + 1 = 2

    k = 2, s= s + k = 1 + 2 = 3, k= k + 1 = 2 + 1 = 3

    k = 3, s= s + k = 3 + 3 = 6, k= k + 1 = 3 + 1 = 4

    k = 4, s= s + k = 6 + 4 = 10, k= k + 1 = 4 + 1 = 5

    k = 5, s= s + k = 1 0 + 5 = 15, k= k + 1 = 5 + 1 = 6

    k = 6, s= s + k = 15 + 6 = 21, k= k + 1 = 6 + 1 = 7

    k = 7, s= s + k = 21 + 7 = 28, k= k + 1 = 7 + 1 = 8

    k = 8, s= s + k = 28 + 8 = 36, k= k + 1 = 8 + 1 = 9

    k = 9, s= s + k = 36 + 9 = 45, k= k + 1 = 9 + 1 = 10

    k = 10, s= s + k = 45 + 10 = 55, k= k + 1 = 10 + 1 = 11

Task No. 10 (a)

Block diagram

Program in Pascal language

Yes

No


program v1_10A;

var x:integer;

begin

writeln("Enter an integer:");

readln(x);

if x>0 then

x:=x+1

else

x:=x-2;

writeln(" Number=",x);

end.

Task No. 10 (b)

B loc diagram

Program in Pascal language

program v1_10B;

const n=10;

var x:array of integer;

i,s:integer;

begin

for i:=1 to n do

begin

writeln("Enter value",i);

readln(x[i]);

end;

s:=0;

for i:=1 to n do

if x[i]>0 then s:=s+x[i];

writeln("Sum of positive numbers=",s);

end.

Option 2

Job number

Answer

Solution

No

No

No

No

a,c,d

The write command looks like this:

First, the name of the command: write or writeln, then an opening bracket; if text is written, put a quote after the bracket; then the text is written or the variables are listed separated by commas, then the bracket is closed, if the text recording ends, then a quotation mark is placed before the bracket; then a semicolon:

Writeln(''); or writeln(a,b);

Option "a" is incorrect because there are no parentheses and the sign is not quoted. Correct entry: Write(‘©‘);

Option " c" is incorrect because the text is not quoted. Correct entry: Write (‘Enter any number’);

Option " d" is incorrect because there are no parentheses. Correct entry: Write (X, Y)

Given two variables f =5 and d =7. The algorithmic construction “branching” calculates the value of the variable x according to a condition. Condition (f >=d) FALSE, because 5<7. Поэтому выполняем действия стоящие после служебного слова «else », а именно x :=d . Получаем, что x =7

Team div is the selection of the whole part when dividing. The mod command is the selection of the remainder of the part when dividing.

x = 8 + 2 * 5 = 8 + 10 = 18

y = (x mod 10) + 14 = (18 mod 10) + 14 = 8 + 14 = 22

x = (y div 10) + 3 = 2 + 3 = 5

c = x – y = 5 – 22 = -17

S=0

Cycle "with counter" I. Repeats three times. Variable I takes values ​​from 2 to 4:

    I = 2, S = S + I = 0 + 2 = 2

Test "Algorithmization"
An algorithm can be considered: description of a solution to a quadratic equation lesson schedule at school technical passport of a car class list in a magazine 1 What is the name of the property of an algorithm that means that this algorithm is applicable to solving a whole class of problems? clarity, certainty, efficiency, mass character 4 The developer of the Pascal language is: Blaise Pascal, Niklaus Wirth, Norbert Wiener Edsger W. Dijkstra 2 What is the name of the property of the algorithm, meaning, that it always leads to a result through a finite, perhaps very large, number of steps? discreteness, comprehensibility, effectiveness, mass character 3 What is the name of the property of an algorithm, meaning that it is specified using such instructions that the performer can perceive and according to which can perform the required actions? discreteness, clarity, certainty, mass character 2 What is the name of the property of the algorithm, meaning , that the path to solving a problem is divided into separate steps? discreteness, certainty, efficiency, mass character 1 What is the name of the property of an algorithm that means that the path to solving a problem is defined quite unambiguously, no ambiguities or omissions are allowed at any step? discreteness, clarity, certainty, efficiency 3 The following forms of recording algorithms have the greatest clarity: verbal recursive graphical line-by-line 3 Quantities whose values ​​change during the process execution of the algorithm are called: constant constants table variables 3 The value of an integer type is: the number of seats in the auditorium the height of a person the make of a car the area of ​​the state 1 When assigned, the following changes: the name of the variable the type of the variable the value of the variable the value of the constant 3 An algorithm is the rules for performing certain actions a directed graph indicating the order of execution of commands a sequence of actions that leads to solving a problem a set of commands for a computer 3 The algorithm is called linear, if it involves repeated repetition of the same actions, the course of its execution depends on the truth of certain conditions; its commands are executed in the order following each other; it is presented in tabular form3. An algorithm is called cyclic if it involves repeated repetition of the same actions; the course of its execution depends on the truth of those or other conditions its commands are executed in the order following each other it is presented in tabular form 1 The algorithm includes branching if it involves repeated repetition of the same actions the course of its execution depends on the truth of certain conditions its commands are executed in the order following each other it is presented in tabular form 2 Property of the algorithm is: efficiency cyclicity the ability to change the sequence of commands the ability to execute the algorithm in reverse order 1 The property of the algorithm, which is that each action and the algorithm as a whole must be able to be completed, is called discreteness, determinism, finiteness, mass character 3 The property of the algorithm, which is that the algorithm should consist of specific actions following in a certain order, The discretion of the determinability of the contrastity of the algorithm, which consists in the absence of errors, is called the algorithm should lead to the correct result for all permissible input values, is the determisiality of the Massory Evaluity of the algorithm, which consists in the fact that the same algorithm can be used with different initial data, is called discretion of the impermeratibility of the Masnia. algorithm, which consists in the fact that any action must be strictly and unambiguously defined in each case, called discreteness, determinism, finiteness, mass character 2 Select the correct representation of the arithmetic expression in the algorithmic language: x + 3y / 5xyx + 3*y / 5*xy(x + 3y) / 5xy(x + 3*y) / (5* x*y)4 An algorithm written in a programming language “understandable” to a computer is called an algorithm executor program listing protocol algorithm 2 An algorithmic structure, the execution of which involves sequential repeated repetition of the same actions - this is branching repetition line cycle 4 An algorithm in which commands are executed in the order they were written, i.e. sequentially one after another, is called cyclic linear branching repetition 2 A form of organizing actions in which, depending on the fulfillment of a certain condition, one or another sequence of steps is performed. branching repetition line cycle 1 An algorithm with repetition of the same sequence of commands is branching repetition line cycle 4 An algorithm is called ... numbered list bulleted list graphic file finite sequence of steps in solving a problem 4 What can be considered an algorithm? rules of technology safety list of class culinary recipe list of responsibilities of the class attendant 3 Flow diagram is a form of writing an algorithm in which ... drawings lists geometric shapes formulas are used to indicate the various steps of the algorithm 3 The geometric figure rectangle is used in flow charts to indicate ... the beginning or end of the algorithm input or output making a decision executing an action 4 The geometric figure oval is used in flow charts to indicate ... the beginning or end of an input or output algorithm for making a decision to perform an action 1 The geometric figure rhombus is used in flowcharts to indicate ... the beginning or end of an input or output algorithm for making a decision to perform an action 3 The geometric figure parallelogram is used in flow charts to indicate ... the beginning or end of an input or output algorithm for making a decision to perform an action 2 An algorithm in which commands are executed in the order they were written, that is, sequentially one after another, called ... linear branching cyclic repetition1