Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > .NET Frameworks (точка нет фреймворки) > C# (си шарп)
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 12.06.2014, 22:53   #1
Octo
Новичок
Джуниор
 
Регистрация: 12.06.2014
Сообщений: 1
По умолчанию Тест по с#

Вечер добрый ! Может кто исправит ошибки в тесте и поможет доделать последних два задания ? Заранее буду благодарен.




1) Consider the following class called “Planet”

Class Planet {
private double MyMass = 30;
Public double DoSomething (double myMass) {
return myMass *this.MyMass; }}

What value will the “My Mass” have after execution the method ?

Do Something (20.0): мой ответ был 600.0

2) A class called “Robot” contains the following two instance variable declarations:
Private int age = 10;
Private bool isConnected;

What is the value of “age” and “isConnected” immediately after it’ s object has been instantiated ?

Age: мой ответ был 10 isConnected: мой ответ был False

3) What constractor’ s name you have to use for a class called “Robot” ?

Мой ответ был: Robot();


4) Are the methods with the following method headers correctly overloaded ? Why yes or why not ?

Public double Average ( int myX, int myY);
Public int Average (int yourX, int yourY);

Мой ответ был: They are not correctly overloaded because they have different types (double, int), they must be the same.

5) If the “Sound” method of the “Animal” class was declared “abstract” would you be able to instantiate an object from this class (Animal) ? Why yes or why not ?

Мой ответ был: No, because we’re not allowed to do this in abstract class.

6) Declare your own abstract class “student”. With abstract variable “name”, “surname”. Can you create instance of an abstract class ?

На этот вопрос я не смог нормально ответить.


7) Define the static class.

Мой ответ был: Static is connected with a class ! Static constructors initialize the static fields of the class.

8) What is the name of the main class in graphic programming ?

Так же не смог дать нормального ответа

9) Declare the delegate with return “int” and one parameter “int” too.

Мой ответ был:

Void myDel (int x)
Class c1{}
{ c1 variable
C1 = new c1}


10) Imagine you create and initialize the delegate type.
My Del delVar = inst.MyMethod 1;
You decided to add to delegate two method MyMethod2 , MyMethod3. Please use C# operation realize this task.

Мой ответ был:
MyDel delVar = new MyDel (inst.MyMethod2);
MyDel delVar = new MyDel (inst.MyMethod3);


11) What will you see on the screen after execution main()

Delegate void PrintFunction();
Class Test {
Public void Print1()
{ Console.WriteLine(“Print1 from…instance); } }

In main() part:
Test t = new Test();
PrintFunction pf;
Pf = t.Print1;
Pf + = t.Print1;
Pf();

Мой ответ был:

Print1 from…instance
Print1 from…instance


12) Using DrawLine() method create triangle with p1(0,0), p2(0,100), p3(100,00)

Мой ответ был :
g.DrawLine (p1, 0 ,0, 0, 100); g.DrawLine (p2, 0 ,100, 100, 100); g.DrawLine (p3, 100 ,100, 0, 0)


13) Call DrawEllipse() method with all parameters.

Мой ответ был:
g.DrawEllipse( p, x, y, weigh, height);


14) Imagine three lines a, b, c are given; Do you remember the formula of the triangle area ? Write the method to calculate this area.
На этот вопрос не дал ответа, надеюсь Вы поможете.

15) Declare the class in 4 dimensional space using x, y, z, u:
На этот вопрос так же не смог дать ответ.


Ссылки на фото:
http://vfl.ru/fotos/c44928f55412983.html
http://vfl.ru/fotos/d7ce37435412984.html

Последний раз редактировалось Octo; 12.06.2014 в 23:46.
Octo вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
запрограммировать в делфи 7 тест Лири и тест Торстона через базу данных (курсовая на 1-м курсе) mekil Помощь студентам 10 10.06.2014 17:56
с++ тест Sport Помощь студентам 5 08.06.2013 17:20
Тест по С и С++ Fstek Помощь студентам 2 16.07.2012 02:06
Тест 0.5 Лунатик222 Софт 0 03.03.2009 22:20