Font size
WorksheetsC# 12
Total questions: 10
Worksheet time: 9mins
Как правильно создать класс?
public class Warrior(){}
public void class Warrior(){}
public class Warrior{}
public void Warrior(){}
Как создать экземпляр класса Warrior?
Warrior MyPerson = new Warrior();
Warrior MyPerson = new class();
class MyPerson = new Warrior();
Warrior MyPerson = new MyPerson();
Что может содержать в себе класс?
Методы и переменные.
Ничего.
Переменные.
Методы.
Сколько вы можете создать экземпляров класса?
3
10
15
∞
Можно ли создать массив классов?
Да.
Нет.
Выберите строчку которая преобразовывает строку в целое число.
string a = Convert.ToInt32("313");
int a = Convert.ToString(32);
int a = Convert.ToInt32("313");
float a = Convert.ToInt32("0");
Выберите методы с возвращаемым значением.
public int method(int a, int b)
public void method(int a, int b)
public float method(int a, int b)
public string method(int a, int b)
public void method(int a, int b)
Что выведет данная программа ?
int a = 10;
int b = 20;
int c = b + a;
if (a > b)
{
Console.WriteLine(c + b);
}
else
{
Console.WriteLine(c - b);
}
10
50
30
20
Как правильно создать цикл повторяющийся 10 раз ?
for ( i < 10) { }
for (int i = 0; i < 10; i++) { }
for (int i = 0; i < 10; ) { }
for (int i = 0;) { }
Как правильно считать строку с консоли ?
Console.WriteLine();
Console.ReadLine();
string s = Console.ReadLine();
Console();
