Test on Pascal data types. Pascal tests. What type should have the change a in the operator a:=’10’

The material allows you to test the initial knowledge of 9th grade students when studying the Pascal language in the form of a test - 2 options - knowledge is monitored when studying data input and output operators, and the assignment operator.

Download:


Preview:

Test: Fundamentals of programming in Pascal

Option I: Option II:

1. Specify the operator (choose from those suggested below) for

Information input: information output:

Readln;

Writeln;

Write.

2. Is the operator written correctly:

Readln('enter a number', a); readln(a);

3. What will appear on the screen after executing the program?

program pr1; program pr1;

uses crt; uses crt;

const s=60; var s:byte;

begin clrscr; begin clrscr;s:=45;

writeln('distance=', s, 'km'); writeln('distance=', s, 'km');

readln; readln;

end. end.

4. Which operator delays the response on the screen?

5. Which operator will display the value of variable X?

Readln(X);

Writeln(X);

Read(X).

6. What is the value of Z after these lines of program are executed?

X:= 27; X:= 27;

Z:=X+3; Z:=X+13;

Z:=Z+5; Z:=Z+5;

Z:=Z/5; Z:=Z/5;

7. What is the value of X after these lines of program are executed?

X:=10; X:=13;

Y:=X*3-X; Y:=X*4/2;

8. What will appear on the screen after executing the program?

program pr1; program pr2;

uses crt; uses crt;

var a,b: byte; var x,p: word;

begin begin

a:=1; x:=7;

b:=a*a; p:=x*x;

writeln(a,b); writeln(x,’ p=’,p);

a:=a+1; x:=x+1;

b:=a*a; p:=x*x;

writeln(‘a=’,a,’ b=’,b); writeln(‘x=’,x,’ ‘,p);

readln; readln;

end. end.


On the topic: methodological developments, presentations and notes

Quiz on the basics of programming in Pascal

Test on the basics of programming in Pascal. It consists of tasks for “recognizing” operators, some functions, function words, for determining the result of program execution and for writing...

Programming. Getting started programming in Pascal

Municipal budgetary educational institution

"Secondary school No. 3"
Isilkul, Omsk region

mathematics and computer science teacher

This test can be used as a final test on the topic “Program control of computer operation” according to the textbook, “Informatics and ICT 9: textbook for grade 9.”

Key to the test:

I option: 1d; 2g; 3g; 4a; 5c; 6a; 7c; 8b; 9b; 10b.

II option: 1b; 2g; 3b; 4b; 5g; 6a; 7c; 8g; 9b; 10a.

Grading:

10 points – “5”

8-9 points – “4”

6-7 points – “3”

Option 1.

1. To separate operators from each other in the Pascal language, use:
a) space; b) colon; c) comma; d) semicolon.

2. Of the proposed program headings, the correct one is:
a) Program amount; c) programm amount;
b) program sum; d) program summa.

3. To display results in the Pascal programming language, use the keyword:
a) VAR; b) READ; c) BEGIN; d) WRITE.

4. The square root of a number is calculated by the function:

5. The final value of the variable Y as a result of the following actions:
U:=5;

Y:=(U-2*X)/2+X
will be equal to:
a) 0.5; b) 2; c) 2.5; d) 5.

6. As a result of program execution

program my_ class;
begin
write (25/2,5*2);
writeln(‘smiles’);
end.

we will see on the screen:
a) 5 smiles; at 5
smiles;

b) 25 smiles; d) 25
smiles.

7. In this fragment of the program

program error;
begin
summa:=25-14;
end.

considered an error:

b) long variable name;


for i:=1 to 5 do B[ i]:= 5+ i;


a) 9; b) 8; at 7; d) 6.

for i:=1 to 10 do begin
if a[ i]>0 then a[ i]:= a[ i]/2
else a[ i]:= i;
end;

the following will happen:
a) positive values ​​of array elements will double, and negative values ​​will be replaced by index values;
b) positive values ​​of array elements will be halved, and negative ones will be replaced by index values;
c) negative values ​​of array elements will double, and positive values ​​will be replaced by index values;
d) negative values ​​of array elements will be halved, and positive values ​​will be replaced by index values.

writeln('New array’);
for i:=1 to 20 writeln(a[i]);
end.

the following will happen:
a) a new array will be formed;


Test on the topic “Pascal programming language”

Option 2.

1. The beginning of the section of the program that describes the types of variables used is defined by the keyword:
a) program; b) var; c) begin; d) write.

2. Of the suggested headings, the incorrect one is:
a) program summa;
b) program summa_chisel;
c) program number;
d) program summa.

4. The squaring of a number is calculated by the function:
a) SQRT (X); b) SQR(X); c) ABS (X); d) INT(X).

5. The final value of variable X as a result of the following actions:

X:= (Y+X)*5-2+X
will be equal to:
a) 0; b) 2; at 8; d) 10.

6. In this fragment of the program

programerrors;
begin
writeln('
errors No’);

writeln (‘5*5=’,25);
end.

considered an error:
a) incorrect program name;
b) absence of a variable;
c) undefined variable name;
d) writing an arithmetic expression.

7. As a result of program execution

program class;
begin
writeln(45/(12-3));
writeln('
classes’);
end.

we will see on the screen:
a) 5 classes; at 5
classes;

b) 9 classes; d) 9
classes.

8. The values ​​of a one-dimensional array are set using a loop:
for i:=1 to 5 do A[i]:= 2+ i;

As a result, the value of B will be equal to:
a) 9; b) 8; at 7; d) 6.

9. As a result of executing a program fragment

for i:=1 to 10 do begin
if a[i]>0 then a[i]:=a[i]/3
else a[i]:=2;
end;

the following will happen:
a) positive values ​​of array elements will triple, and negative values ​​will be replaced by 2;
b) positive values ​​of array elements will be reduced by three times, and negative ones will be replaced by 2;
c) negative values ​​of array elements will double, and positive values ​​will be replaced by 3;
d) negative values ​​of array elements will be halved, and positive ones will be replaced by 3.

10. As a result of executing a program fragment

writeln('New array’);
for i:=1 to 20 readln(a[i]);
end.

the following will happen:
a) a new array will be formed;
b) the new array will be printed;
c) only indexes will be printed;
d) only indexes will be generated.

Information sources:

1. , “Informatics and ICT 9: textbook for grade 9”: Moscow, “Binom. Knowledge Laboratory", 2011-2013

2. “Construction of test tasks in computer science: a methodological manual”: Moscow, “Binom. Knowledge Laboratory", 2003

3. “Lesson-based developments in computer science, grade 9”: Moscow, “VAKO”, 2012.

Test

1 option

    Is it called an algorithm?
    A. Ordered sequence of actions;
    B. Computer instructions for completing the task, written in a special language;
    C. Operator withdrawal procedure;
    D. Creating executable files.

    2. What does a semicolon mean in Turbo Pascal:
    A. End of cycle;
    B. End of program;
    C. Separates statements from each other;
    D. End of program line;

    3. Specify the correctly written name of the program:
    A. Figure 1;
    B. Ugrant 1;
    C. grant2;
    D. 1 drawing;

    4. Operator brackets are written using
    A. Else then;
    B. Begin end;
    C. Input output;
    D. Write read;

    5. The commands that make up a Pascal program are called:
    A. Compilers;
    B. Interpreters;
    C. Operators;
    D. Editors;
    6. What function word describes fractional variables:
    A.INTEGER;
    B.REAL;
    C.CHAR;
    D. BOOLEAN;
    7. How does the program end?

8.The format of the complete branch statement is as follows:

B.If then else ;

9. The operator for organizing branching in programming languages ​​is...

A. Operator to organize a dialogue with the user;

B. Conditional operator, selection operator;

C. Loop operator.

Test

Option 2

1. What type of programming language is Turbo Pascal?
A. Natural;
B. Algorithmic;
C. Logical;
D. Object-oriented;

2. What does the := sign mean in the PASCAL programming language?
A. Assignment;
B. Comparison;
C. Equality;
D. Division;

3. What type of variables are described by the service word INTEGER:
A. real numbers;
B. integers;
C. character variables;
D. boolean variables;

4. Find the correct type of title bar:
A. Program grant;
B. Program grant
C. Program grant2;
D. Program 1 grant;

5. The VAR descriptions section is used to describe:
A. Constant;
B. Variables;
C. Functions;
D. Marks;

6. Which operator is the newline operator:
A.WRITE
B.READLN
C. WRITELN
D.READ

7. Which option starts the program execution:
A.Open;
B.Run;
C. Exit;
D. Paste;
8. How is the output statement written?

D.Write()
9.What is the variable characterized by?

A.Name, type, value.

B.Name, meaning.

C.Value, type.

1. What special characters are used to highlight comments in programs?

a) () or (**)

b) only ()

c) only (**)

d) other special characters

2. What will appear on the display screen after running this program?

writeln('x+1');

3. Test. What keyword does the variable description section begin with?

4. What section of responsibilities is present in the program structure?

a) Section of operators, highlighting the key words begin and end.

b) Section of variables that begins with the words var

5. What is the name of the decoupling stage in U A Y, when the written program is interrupted only for the presence of syntax errors?

a) Setting up

b) Testing

c) Algorithmization of the problem

6. What is the name of the decoupling stage in U A Y, when the written program is tested on conditional input data to obtain a known result?

a) Setting up

b) Testing

c) Algorithmization of the problem

7. Who is considered the creator of the Pascal programming language?

a) 1970, Necklaus Wirth

b) 1980s, Borland company

c) 1964, John Kemeny, Thomas Kurtz

8. Which of these program or variable names is correct?

9. How can arithmetic operations be performed in Pascal?

a) Exponentiation (^)

b) Division without remainder (div)

c) logical addition (or)

d) Logical multiplication (and)

9. The result of performing operation 1/5 is equal to...

10. The result of the operation 1div 5 is equal to...

11. The result of performing operation 10 div 3 is equal to...

12. The result of operation 10/3 is equal to...

13. The result of performing operation 1 mod 5 is equal to...

14. What is represented by a diamond in block diagrams?

a) choosing one of two agreements

b) the beginning or end of the program

c) computing process

d) Data input/output

15. What symbols can be used in a noun pronoun (identifiers)?

a) Latin letters and numbers after them, underscore;

b) Only numbers

c) Cyrillic letters

d) Reserved words

16. At the end of the program it is written...

a) Semicolon

c) Nothing is placed

d) comma

Test No. 17. Mathematical expression in the Pascal programming language will be written as...

a) a/1+sqr(2*a);

b) a/(1+sqr(2*a));

c) a/1+2*sqr(a);

d) a/(1+2*sqr(a)).

18. What is represented by a rectangle in block diagrams?

b) Start or end of the program

c) Computational process

d) Introductions/data entry

19. What is represented by a parallelogram in block diagrams?

a) Choosing one of two conditions

b) Start or end of the program

c) Computational process

d) Data input/output

20. What keyword begins the description of constants?

21.Test. What do operator brackets look like in Pascal?

d) begin...end.

22. What type will the change r in the operator r:=a*b+a mod b have if a, b: integer?

23. The value of the logical expression not(5<0) or (6<>7) and (10>8) equals

24. What type will have the change r in the operator r:=a/b + a mod b if a, b: integer?

25. What type should have the change a in the operator a:=’10’?

26. Which of these values ​​is real data?

27. How many characters can be assigned to a char type change?

a) equals 1

b) from 1 to 255

c) how much will be needed

28. Changing r with b = 5 i c= - 8 in the operator r:=b > c has a type and values...

a) Boolean, true

b) integer, integer values

c) The operator is invalid.

29. Which Boolean expression will evaluate to false?

a) not (false) and true

b) true or false

30. Which Boolean expression will evaluate to true?

a) ((5<0) and (6>7)) or not (10>8)

b) (5<0) and (6>7) or (10>8)

at 5<0) and ((6>7) or (10>8)

31. Which function gives a symbol as a result?

32. Is it correct that chr (ord (‘A. b))=’A’?

C) This expression has no content.

33. What value will the variable have With after executing the statement with:= round(3.86)?

34. What value will the variable have With after executing the statement with:=trunc(3.86)?

35. What is used to separate operators from each other?

A) Comma;

B) Colon;

B) Pass;

D) Semicolon.

36. Which operator displays information on the screen?

Test No. 37. Which of these Pascal program headers are incorrect:

A) Program Begin;

B) Program search_pic;

B) Program search.

38. What is the name of a named area of ​​memory that takes on different values ​​during program execution?

A) String;

B) Symbol;

B) Variable;

D) Constant.

39. How to write a mathematical expression in Pascal 1< x<5 ?

A) (1

B) 1

IN 1

D) 1

40. For variables a and b of type Integer, type Real will have the expression...

D) sqr(a)+ sqr(b);

41.Test. What is a constant?

A) A quantity whose values ​​are set during program execution;

B) A quantity whose values ​​do not change during program execution;

C) A quantity whose values ​​change during program execution.

42. Which records of calls to standard functions are incorrect?

D) chr(‘15’). _______

43. The mathematical expression \/1+ sin2x in Pascal programming language will be written as...

A) sqrt (1 + sin (sqrx));

B) sqrt(1 + sqrsin(x);

B) sqrt (1 + sqr (sin x);

D) sqrt (1 + sqr (sin (x))).

44. What type will the variable c have after executing the operator c:=(3-2)/1?

45. What value will the variable a have after executing the group of operators c:=5; a:=succ(c)?

46. ​​For real y and integer x, z, the expression sin(x)+2*cos(y) +z has the type:

Control test on the topic “Pascal Operators”

1. The VAR service word in a Pascal program fixes the beginning of a program section containing:

A) operators;

B) list of tags;

C) description of complex data types;

D) list of constants;

D) description of variables.

2. The Pascal alphabet does not include a function word:

A) THEN; B) BEGIN;

B) END; D) STEP; D) IF.

3. Numbers in Pascal are different:

A) as natural and whole;

B) as integers and reals;

C) as natural and material;

D) as whole and irrational;

D) as whole and rational.

4. Formal parameters of the procedure:

B) are listed when the procedure is called;

C) are indicated when describing data in the program;

D) declared when describing intermediate procedure variables;

D) are assigned during program execution.

5. In the Turbo Pascal system, the beginning of a program section containing a list of labels is fixed with a service word:

A) CONST; B) TYPE;

B) VAR; D) LABEL; D) BEGIN.

6. The operator for organizing data input from the keyboard in the Turbo Pascal programming system is written using a function word:

A) WRITE; B) INPUT;

B) READ; D) DEFFN; D) RESET.

7. The commentary on the program text in Pascal is as follows:

A) in curly braces;

B) in parentheses;

B) in square brackets;

D) in apostrophes;

D) between the function words Begin, End.

8. The service word CONST in a Pascal program fixes the beginning of a program section containing:

A) list of constants;

B) list of tags;

C) description of variables;

D) operators;

D) description of complex data types.

9. The following cannot be used as a name in Pascal:

A) BR; B) OR; B) WR; D) AR; D) DR.

10. When writing an output statement in Pascal, a service word is used:

A) WRITE; B) RESET;

B) READ; D) BEGIN; D) WHILE.

11. Operators in a Pascal program are separated from each other:

A) apostrophe; B) colon;

B) space; D) comma; D) semicolon.

12. Logical expression (X=A) AND (X

A) x belongs to the segment ;

B) x belongs to the union of intervals and ;

B) x belongs to the union of the intervals [minus infinity, A] and ;

D) x belongs to the union of intervals and and [minus infinity, B];

E) x belongs to the intersection of the intervals [minus infinity, A] and ;].

13. Actual parameters of the procedure:

A) are described in its title;

B) are indicated when describing data in the program;

B) are listed when it is called;

D) are not indicated anywhere;

D) are indicated when describing intermediate procedure variables.

14. In the program for calculating the sum of the elements of an arithmetic progression (with its first term, difference and number of its terms known):

Program ArifPro;

Var a, d, s: real; n:integer;

Begin readln(a, d, n); s:= ; writeln(s) End.

no arithmetic expression is specified in the assignment operator. It

can be written as:

A) a*n/2+d*(n–1)*n/2;

B) a*(n+d*(n–1)*)n/2;

B) a+d*(n–1)*n/2;

D) a*n+d*(n–1)*n/2;

D) a/n+d*(n–1)*n/2.

15. Given the program:

Program T21; Var X: Integer;

Begin Readln(X);

If X MOD 2=0 Then Writeln(‘YES’)

Else Writeln('NO') End.

At what value of X will the answer “YES” be received?