Write down the value of the resulting s variable. Algorithmic programming language. The Lisp language belongs to the ____________ programming languages

| Test

Lesson 38
Test

"Algorithmization and Programming"

Attention! the test contains questions and code points from Pascal!


First option

Part 1.

1. What does an assignment sign look like in programming?:

  1. <=

2. What is the name of an algorithmic construction, which consists of sequential actions, in a strictly ordered order one after another following?

  1. Follow
  2. Branching
  3. Repetition

3. What is the algorithm shown in the picture?:

  1. Follow
  2. Branching
  3. Repetition

4. Select the correct program entry :

  1. programm Yakov_petrovich;
  2. program Yakov petrovich;
  3. program Yakov Petrovich;
  4. program_Yakov_Petrovich;

5.With which command can you find out the remainder of the division of the number aon theb:

Part 2.


1. Write down the value of the variable b

a: = 4;

x: = 10;

a: = x-a * 2;

x: = a * 2-x;

2. What will be the result of this algorithm? Write down the answer :

a: = 5;

b: = 7;

if a> b then b: = a + b-28

elseb:= a* b-30;

3. What will be the result of this algorithm? Write down the value you get for the variable b

a: = 7;

b: = 22;

a: = b div a;

b: = b mod a;

4. What value of b will be obtained after executing the algorithm? Write down the answer. (If you need to round up your answer, round to tenths)

a: = 3;

b: = 90;

for i: = 1 to 4 do

b: = b / a;

  1. program cup_of_tea;
  2. var a, b, c, y, x: real;
  3. begin
  4. writeln (‘Please enter three numbers’);
  5. readln (a, b, c);
  6. y: = a;
  7. if b> y then y: = b;
  8. if c> y then y: = c;
  9. if ab) or (a> c) then x: = a;
  10. if ba) or (b> c) then x: = b;
  11. if ca) or (c> b) then x: = c;
  12. writeln (y + x);
  13. end.
  1. What is the name of the program? Write
  2. Write down what type of variables is used in the program.
  3. Write down the names of the variables used.
  4. In which line does the program receive data from the user? Write line number
  5. What will be displayed if the user enters values: 6, 9, 3

Part 3. Write a program.

Three numbers are entered. Print the smallest number.

Second option

Part I

1. The design of an algorithm in which, as a result of checking the fulfillment of a condition, various actions can be performed is called:

  1. Follow
  2. Branching
  3. Repetition

2. Not equal in pascal is written:

3. Which entry is correct:

  1. write (Set variables a and b);
  2. write (‘ Set the variables a and b ');
  3. write (‘ Set the variables ', A and b);
  4. write ( Set the variables , 'A and b');

4. The block diagram shows the algorithmic structure:

  1. Linear Algorithm
  2. Branching Algorithm
  3. Repetition algorithm

5. The command in pascal that allows you to read the data received from the user:

  1. write

Part 2.


1. What is the value of the variable k after the execution of this algorithm:

a: = 2;

k: = 4;

a: = k + a * 3;

k: = a / 2-k;

2. Write down the value of the variable b after executing a fragment of the algorithm:

a: = 7;

b: = 5;

if a> b then b: = a + b + 5

elseb:= a* b-3;

3. Write down the value of the variable b after executing a fragment of the algorithm:

a: = 4;

b: = 15;

a: = b div a;

b: = b mod a;

4. Write down the value of the variable b after executing a fragment of the algorithm:

a: = 2;

b: = 5;

for i: = 1 to 5 do

b:= a* b;

5. Review the algorithm and answer the questions:

program Chulok;

var a, b, c, y: real;

begin

writeln(‘Enter three numbers’);

readln (a, b, c);

y: = a;

if b> y then y: = b;

if c> y then y: = c;

writeln( y) ;

end.

  1. Write the name of the program.
  2. What type of variables is used in the program.
  3. How many variables are used in the program, indicate their names.
  4. Rewrite the line where the program receives data from the user.
  5. What will be displayed if the user enters the values: 5, 8, 2.

Part 3. Write a program.

Given two integersaandb ( a< b). Print in ascending order all integers between a andb(including the numbers themselvesaandb), as well as the numberNthese numbers.

Data type

Description

8-bit (1 byte) unsigned numbers in the range from 0 to 255. The data type can be used when parsing ASCII character codes or simple calculations, if you know in advance that the result will not exceed 255. For example, using a Byte variable can store the number of days in a month, since the maximum value does not exceed 31.

16-bit integers ranging from -32768 to 32767. The numeric data type Integer is often used to access the elements of an array or collection.

32-bit integers (4 bytes) ranging from -2,147,483,648 to 2,147,483,647. Variables of this type allow you to store the results of arithmetic expressions that use large enough integers. For example, the Long data type may be required when calculating large primes, Fibonacci numbers, factorial of a number, etc.

96-bit (12 bytes) unsigned numbers. In the fractional part, writes the power of the number. In this case, the number of decimal places can vary in the range from 0 to 28. In variables of the type Decimal you can store extra-large integers in the range -79 * 10 28 to 79 * 10 28.

64-bit (8 bytes) double precision floating point numbers for numbers in the range -1.798E + 308 to -4.941E-324 for negative values and from 4.941E-324 to 1.798E + 308 for positive values.

This data type is used when higher precision of calculations is required.

32-bit (4 bytes) floating point numbers in the range -3.403E38 to -1.401E-45 for negative numbers and 1.401E-45 to 3.403E38 for positive numbers.

The data type is used to store string values ​​of a variable (up to 2 billion characters) or constant (64K characters) length.

A data type that allows you to work with calendar dates and times. In computer memory, the Date type is a 64-bit floating point number that can store dates in the range January 1, 100 through December 32, 9999, and times in the range from 0:00:00 to 23:59:59.

16-bit numbers that take two values ​​True (all bits of the number are set to one, which corresponds to -1) and False (all bits of the number are cleared to zero, which corresponds to the number 0). Boolean variables are used when comparing expressions, in conditions and in some types of loops.

Variable for storing references to objects of Visual Basic and other applications

Allows to store data of any type - numbers, strings, dates and empty values.

An object type can be broken down into category types - forms, elements, printers, etc.

To declare a new variable, the Dim statement is used, the syntax of which is as follows:

Dim<идентификатор> , <идентификатор1> ...

<идентификатор>is the name of the variable.

<тип>is a valid data type.

For example, the following construct declares the variable V1:

Dim V1 As Integer

The type of the variable and, accordingly, the construction As can be omitted. In this case, the variable is not typed. When declaring several variables at the same time, the following construction Dim A, B, C As Integer is very often used. Moreover, it is assumed that all three variables are integers. In fact, this is not the case. Only the variable C is integer, and the variables B and C are untyped. A more correct way of writing is this:

Dim A As Integer, B As Integer, C As Integer

Assigning a value to a variable

The initial value of the variable is 0 for numeric data types and an empty string "" for string values. In most cases, this value is quite suitable for the conditions of the problem. So, you can compose a program for summing the rows of array A without zeroing the value of the variable S:

Dim S
For I = 1 To 5
S = S + A [I]
Next

Such a program will not generate an error during execution and will correctly sum up the five elements of the array. But the rules of good form in programming still force you to assign an initial value to a new variable before using it. One more line should be added to the program for summing array elements:

Dim S
S = 0
For I = 1 To 5
S = S + A [I]
Next

There are two ways to assign a value to a variable: explicitly using the appropriate language instructions Visual Basic for Application or implicitly, like loop variables. V following examples showing different ways assigning values ​​to variables:

Numeric variable
Dim Year As Integer
Year = 2003

Boolean variable
Dim IsTrue As Boolean
IsTrue = True

· variable of type date
Dim BD As Date
BD = # 10/4/03 #

Calculating the value of an expression
B = (3 * (3 + 4)) / 4

Use of functions Visual Basic for Application
S = InputBox ("Please introduce yourself")

· The initial value of the variable is 1, the final value is 5.
For I = 1 to 5
Debug.Print I
Next

Variable I can also be used at the end of the cycle

The basic principles of structured programming do not apply ...

When developing a software product, the elimination of defects noticed by the user is carried out at the stage _________

The Lisp language belongs to the ____________ programming languages

The object-oriented approach to programming is based on the principle ...

It does not belong to the main algorithmic constructions ...

Interpreters do ....

Encapsulation in Object Oriented Programming Means Possibility ...

The program is ...

The data markup languages ​​are ..........

The first step in solving the problem on a computer is ....

The object-oriented approach is based on the concept ...

Load module of the program - result of work ...

The modular structure of the program reflects one of the features of _______________ programming.

The table of identifiers in the process of translation is used to store ...

Designing programs by sequentially breaking down a large task into smaller sub-tasks corresponds to ...

When developing a software product, comparing the results of the program with the results of observations or results obtained experimentally refers to the stage

There is no _____________ data type in procedural programming languages.

one). symbolic

2). complex

3). integer

4). Real

one). debugging and testing the program

2). analysis and formalized description of the problem

3). accompaniment of the program

4). analysis of the results

one). bottom-up design

2). object-oriented design

3). top-down design

4). conceptual modeling

5. The language whose name is an acronym for "universal symbolic code for beginners" is ...

one). variable values

2). function results

3). variable and function names

4). results of procedures

7. The concept of "Polymorphism" refers to

one). object-oriented programming technologies

2). structured programming technologies

3). modular programming technologies

4). imperative programming technologies

one). heuristic

2). dynamic

3). logical



4). The structural

one). interpreter

2). grammar

3). translator

4). linker (linker)

one). formalization of properties

3). class hierarchies

4). Recursions

one). formulation of the problem

2). testing

3). debugging

4). algorithm development

one). P = True; Q = False

2). P = False; Q = True

3). P = False; Q = False

4). P = True; Q = True

one). complete minimal semantic expression in a programming language

2). algorithm written in a programming language

3). command set operating system computer

4). computer network component interaction protocol

one). implementation of the correspondence "" one module - one object ""

2). definition of the interface (specification) of methods for their implementation

3). creation special programs that implement a change in the state of the object

4). conclusion in a separate module of procedures for working with an object

one). operator-by-operator processing and program execution

2). operator-by-operator processing without program execution

3). only broadcast of the program

4). tracing and program execution

The task: "enter two numbers and find their arithmetic mean and geometric mean and give the result" corresponds to the algorithm ...

one). substitution

2). branching

3). precondition loop

4). loop with postcondition

one). dichotomous search

2). branches and boundaries

3). top-down design

4). bottom-up design

one). systemic

2). functional

3). structural

4). Indefinite

one). debugging and testing

2). analysis of the results

3). program coding

4). software product support

one). top-down programming

2). splitting the project into modules, each of which has one input and one output

3). reaching the absolute minimum of characters and lines in the program text

4). program logic allows only three basic algorithmic structures: sequencing, branching, and repetition

29. Attributes of a variable in programming languages: a) name b) address c) visible / hidden d) value e) type f) functionality

one). a B C D

2). a, b, d, e

3). b, d, e, f

4). a, c, d, e

one). number of zero

2). number of positive

3). last zero number

4). first zero number

34. What value of the variable S will be printed after executing the fragment of the program in BASIC?

Algorithmization and programming

2. In procedural programming languages ​​there is no 2) complex

Data type.

When developing a software product, comparing the results of the program with the results of observations or results obtained experimentally refers to the stage

1) debugging and testing the program

4. Designing programs by sequentially dividing a large problem into smaller subtasks corresponds to ... 3) top-down "top-down" design

5. The language whose name is an abbreviation for "universal symbolic code for beginners" is 4) Basic

6. The table of identifiers in the process of translation is used to store ... 3). variable and function names

7. The concept of "Polymorphism" refers to 3) modular programming technologies

8. The modular structure of the program reflects one of the features 2) dynamic programming.

10. The loading module of the program - the result of work ... 4) linker (linker)

11. The object-oriented approach is based on the concept 3) class hierarchies

12. The first step in solving the problem on a computer is 1) problem statement

13. Data markup languages ​​are 1) HTML and XML

3) P = False; Q = False

16. The program is 2) an algorithm written in a programming language

Encapsulation in Object Oriented Programming Means the Possibility

2) defining the interface (specification) methods for their implementation

18. Interpreters perform 1) operator-by-operator processing and program execution

The task: "enter two numbers and find their arithmetic mean and geometric mean and give the result" corresponds to the algorithm ...

22. It does not belong to the main algorithmic constructions. 1) substitution

The object-oriented approach to programming is based on the principle

4). bottom-up design

26. The Lisp language belongs to languages 2) functional

Programming

27. When developing a software product, the elimination of shortcomings noticed by the user is carried out at stage 4) maintenance of the software product

The basic principles of structured programming do not include

3) achieving the absolute minimum of characters and lines in the program text

29. Attributes of a variable in programming languages: a) name b) address c) visible / hidden d) value e) type f) functionality 2). a, b, d, e

1) the number of zero

A fragment of the algorithm is shown in the form of a block diagram. Determine what value of the variable S will be printed as a result of the execution of the algorithm.

What value of the variable S will be printed after executing the BASIC code fragment?

For N = 1 To 3

Print S 4)6

4) finds the number of digits of the entered number

38. The definition of "suitability of an algorithm for solving a certain class of problems" refers to the property of algorithms, which is called 3) mass

39. A translator that translates the source program into an equivalent resulting program in the language of machine instructions is called 4) Compiler

40. In procedural programming languages ​​there is no 2) complex

Data type.

41. The concept of "Polymorphism" refers to 1) object-oriented programming technologies

Database

4) is key in both tables

1) parametric

3. Relational databases represent dependent data in the form 1) related tables

5. The language of queries to relational databases is 1) SQL

6. In a relational database, a field is 4) a column in a table

7. By the way of access to databases, DBMS are distinguished 2). client-server

How many records are in the submitted database? 4)4

9. What records will be found after searching in the Computer text box with the term “contains a Pentium”?

10. In a relational database, a table field 3) table column

11. In a relational database, all elements of one column in a table 1) are of the same type and length

12. Insert the missing words into the definition: Database management system is 1) a set of software and language tools necessary for creating databases, keeping them up to date and organizing the search for the necessary information in them.

13. Insert the missing words into the definition: Database is 2) named and structured a set of data related to a specific subject area.

14. In a relational database table 3) each field has a unique name

15. In what order will the records in the database be located after sorting in ascending order in the Memory field?

16. In a relational database 2) the data is presented in the form of one or more interconnected tables

17. Insert the missing words into the definition: The field whose value 3) uniquely identifies the corresponding entry , is called the key field.

18. When you enter a condition on a date value in Access DBMS, the correct record is 1)> # 01.01.55 # And<#01.01.75#

19. Database field can contain 2) text, number and other types of data

20. The concept of a transaction corresponds 1) Last. operations on data, which is considered in the DBMS as a whole

2) many to many (M: M)

22. Acess form can be created based on 2) tables and queries

23. Relationships between tables in MS Access are automatically established when using the Wizard 2) substitutions

Global and local networks

1. The topology of a network with sequential servicing of nodes is called 4) Ring

2) communication protocol with a remote computer

4. A computer that has 2 network cards and is designed to connect networks is called 1) router

6. The communication line with the minimum delay is 2) fiber optic

7. The application for viewing hypertext pages is called 4) Browser

8. The IP address assigned automatically when the device connects to the network and used until the connection session ends is called 4) Dynamic

9. FTP is 3) the name of the network protocol serving the reception and transmission of files

4) twisted pair

11. The Open Network Interconnection (OSI) model includes 1) seven levels of interaction

1) common bus

13. Browsers include 1) Opera

14. FTP is designed for 1) file transfer

16. The browser is 2) a web viewer

17. A modem is 4) technical device

18. Electronic mail (e-mail) allows you to transfer 3) messages and attached files

19. A modem transmitting information at a speed of 28 800 bit / s can transmit two pages of text (3 600 bytes) within 3) 1 second

20. A computer connected to the Internet must have 1) IP address