Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Билеты 2 семестр основы алгоритмизации (англ).doc
Скачиваний:
1
Добавлен:
19.11.2019
Размер:
484.86 Кб
Скачать

Some tests for your program:

Input data

Output data

3

8

9

10

2

15

20

30

11

11

16

24

3

4

12

100

2, 8

or

8, 2

3

83

9

10

21

15

20

30

11

11

16

24

3

4

12

100

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №__6_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

1. If statement and its syntax.

  1. Problem (A). Declare a function which evaluates and returns the perimeter of the equilateral triangle. The function must take an input parameter – the side of the triangle. Read the value of the triangle’s side from the Edit component and evaluate triangle’s perimeter, using a call to the function.

Problem (B). Declare a function which evaluates and returns the sum of the array’s elements. The function takes an input parameter – the array. In the caller declare 2 arrays and read them from StringGrid or Memo components. Call the function to calculate the sums of their elements. Your application may have a user interface like that:

Problem (C). Read an input real two-dimensional array from the file, display it on the form using StringGrid component. Transpose the array and exchange its first and last rows. Display output array on the form and write it to the file. Your application may have a user interface like that:

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №__7_

По Основы алгоритмизации_и___

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

1. Loops (for, while-do, repeat-until).

  1. Problem (A). Declare a Delphi function which calculates and returns the value of the following mathematical function f(x)=x^2+4x+3. The Delphi function must take an input parameter x – the argument of the mathematical function. Evaluate f(2.2) and f(-1), using calls to the Delphi function. Your application may have a user interface like that:

Problem (B). Declare a function which evaluates and returns the maximal element of the array. The function takes an input parameter – the array. In the caller declare 2 arrays and read them from StringGrid or Memo components. Call the function to calculate the maximal of their elements (refer to Variant 6 Problem 2 for an example of possible user interface for your application).

Problem (C). Declare a record type TStud which contains three fields: 1) student’s name 2) student’s speciality 3) student’s age. Declare TStudS type - an array of TStud-records. Declare a variable of TStudS type. Declare a function which determines and returns the number of students of given speciality. The function takes 2 input parameters – 1) an array (a parameter of TStudS type) 2) a speciality for search of string type. In the caller read the array from the StringGrid component and the speciality for search from the Edit component. Using a call to the function determine the number of students of given speciality. Display the result on the form.

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №__8_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

1. Arrays. Array declarations, array types, access to array elements.

  1. Problem (A). Read the values of the variables a, b and c from the file. Evaluate the following expression: a^2+b^2+c^2, display the result on the form and write it to the file.

Problem (B). Declare a function which evaluates and returns the number of array’s elements equal to k. The function takes two input parameters – the integer array to analyze and the value k to be compared with. In the caller declare 2 arrays and read them from StringGrid or Memo components. Call the function to calculate the number of the first array’s elements equal to 10 and the number of the second array’s elements equal to -2 (refer to Variant 6 Problem 2 for an example of possible user interface for your application).

Problem (C). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) student’s age. Declare TStudS type - an array of TStud-records. Declare a variable of TStudS type. Declare a function which determines and returns the index of record containing information about the first student with the given name. The function takes 2 input parameters – 1) an array (a parameter of TStudS type) 2) a name for search of string type. In the caller read the array from the StringGrid component and the name for search from the Edit component. Using a call to the function determine the index of the record which contains information about the first student with the given name. Display the result record on the form using the obtained index.

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №__9_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

1. Characters and strings.

  1. Problem (A). Declare a Delphi function which evaluates and returns the value of the following mathematical function: f(x,y)=3x^2+4y^2+5xy-4x-3. The Delphi function must take two input parameters x and y – the arguments of the mathematical function. In “the main program” calculate f(x1,y1), using a call to the Delphi function. Read the values of the actual parameters x1 and y1 from the corresponding Edit components and pass them to the function.

Problem (B). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) student’s age. Declare an array of TStud-records. Read the array from the StringGrid component. Calculate and display on the form the average age of all the students (refer to Variant 7 Problem 3 for an example of possible user interface for your application).

Problem (C). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) student’s age. Declare TStudS type - an array of TStud-records. Declare a variable of TStudS type. Declare a function which calculates and returns average age of all the students. The function takes one input parameter of type TStudS. In “the main program” read the array from the StringGrid component. Determine students’ average age using a call to the function. Display the result on the form.

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №_10_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

  1. Pos, Copy and Length functions. Insert and Delete procedures.

  1. Problem (A). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) year of birth. Declare two variables of TStud type. Read the values of all the fields from the corresponding Edit components and display them on the form (using Label components). Your application may have a user interface like that:

Problem (B). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) student’s age. Declare an array of TStud-records. Read the array from the StringGrid component. Increase all the students’ ages by 1 and display the modified array in another StringGrid component (refer to Variant 7 Problem 3 for an example of possible user interface for your application).

Problem (C). Declare a record type TStud which contains three fields 1) student’s name 2) student’s speciality 3) student’s age. Declare TStudS type - an array of TStud-records. Declare a variable of TStudS type. Declare a procedure which finds the word “mathematics” in the name of student’s speciality and replaces it with the word “programming”, for example it is supposed to replace “applied mathematics” with “applied programming”. The procedure takes one input/output parameter of type TStudS. In “the main program” read the array from the StringGrid component. Modify the array using a call to the procedure. Display the modified array on the form.

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №_11_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

  1. TStringGrid component and its properties.

  1. Problem (A). On clicking the button draw the following picture ( together with the lines and legends) on the form:

Blue color Red color Yellow color

Problem (B). On clicking the button draw the following picture on the form (use the Polygon method):

Problem (C). Declare a record type TCircle which contains four fields 1) 2) X0, Y0 - the coordinates of the circle’s center 3) R – the circle’s radius 4) Color – the circle’s color (you may use 5-6 colors). Declare TCircleS type - an array of TCircle-records. Declare a variable of TCircleS type. Read the array from a file and display it in StringGrid component. Draw all the circles determined by the array. Your application may have a user interface like that:

Преподаватель ___________________________

Санкт-Петербургский колледж информатизации и управления

(наименование среднего учебного заведения)

Рассмотрено предметной комиссией

“ “ ___________20 г.

Председатель__________

Экзаменационный билет №_12_

По Основы алгоритмизации и____

программирования_______

(предмет)

Группа__341a___ Cеместр__VI______

«Утверждаю»

Зам. директора по учебной работе

_________________

“ “_______20 г.

1. File input and output. Input and output procedures and functions.

2. Problem (A). Draw the following picture (together with the legends) on the form:

Problem (B). Draw the following picture on the form (use the Polyline method):

Problem (C). Declare a record type TFlag which contains six fields 1) 2) X1, Y1 - the coordinates of the upper left corner of rectangular flag 3) 4) X2, Y2 - the coordinates of the lower right corner of rectangular flag 5) 6) TopColor, BottomColor – two colors of the flag (you may use 5-6 colors and your own coding for these colors, for example 1- red, 2-green, 3-blue, 4-white, 5-black, 6-yellow). Declare TFlagS type - an array of TFlag-records. Declare a variable of TFlagS type. Read the array from a file and display it in StringGrid component. Draw all the flags determined by the array. Two-colored flag must look like that:

height/2

Top Color

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]