wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Программирование тест №2

Total questions: 10

Worksheet time: 14mins

Name
Class
Date
1.

Выберите тип данных для хранения строк.

a)

String

b)

Strange

c)

Строка

d)

Int

2.

Выберите правильно написанный цикл for.

a)

for(string i = 0; i < 3; i++){}

b)

for(int i = 0; i++){}

c)

for(int i = 0; i < 3; i +=1){}

d)

for(int i = 0; ){}

3.

Выберите правильно написанный цикл While.

a)

While(true){}

b)

While(string){}

c)

While(int i = 0; i< 1; i++){}

d)

While{}

4.

Выберите как правильно создавать массив целых чисел.

a)

int[] array = int[5];

b)

int array =int;

c)

int[] array =new int[5];

d)

int[] array =int[string];

5.

Выберите как правильно задать элемент массива array.

a)

array[0](5);

b)

array[0] = 5;

c)

array[] <> 5;

d)

array[float] != 5;

6.

Выберите строку которая возвращает количество элементов в массиве array.

a)

array[];

b)

array.length();

c)

array.длинна();

d)

array(length);

7.

Выберите как правильно вывести все элементы массива array;

a)

Console.WriteLine(array);

b)

for (int i = 0; i = Length;i){

Console.WriteLine(array[i]);

}

c)

for (int i = 0; i < array.Length;i++){

Console.WriteLine(array[i]);

}

d)

Console.Write(array[i]);

8.

Выберите как правильно ввести с консоли массив чисел.

a)

for (int i = 0; i < array.Length;i++)

{

array[i] = Console.ReadLine();

}

b)

for (int i = 0;i++)

{

array[i] = Convert.ToInt32();

}

c)

for (int i = 0; i < array.Length;i++)

{

}

array[i] = Convert.ToInt32(Console.ReadLine());

d)

for (int i = 0; i < array.Length;i++){

array[i] = Convert.ToInt32(Console.ReadLine());

}

9.

Выберите строчку в которой нет ошибок.

a)

string str = Console.ReadLine();

b)

string str = Console.ReadLine

c)

string str = Console.WriteLine();

d)

string str == Console.ReadLine();

10.

Выберите строчку с ошибкой .

a)

string str = Console.ReadLine();

b)

Console.WriteLine(" str ");

c)

int number = 10.5;

d)

float number = 10f;