Download presentation
Presentation is loading. Please wait.
Published byLinette White Modified over 9 years ago
1
Asya Georgieva Telerik Software Academy academy.telerik.com QA Trainer http://telerikacademy.com
3
Indicate the incorrect purpose of the Framework Class Library (FCL)? a)Provides functionality for creating console applications b)Provides functionality for creating WPF and Silverlight rich-media applications c)Provides functionality for creating iOS and Android applications d)Provides functionality for creating Windows Forms GUI applications e)Provides functionality for creating web applications (dynamic Web sites) 3
4
Indicate the incorrect purpose of the Visual Studio IDE? a)Edit images b)Design user interface c)Write code in many languages d)Execute / test / debug applications e)Browse help and web f)Edit excel documents g)Manage project's files 4
6
What will the following code result in? 6 char zero = '0'; char one = '1'; char two = '2'; char three = '3'; char four = '4'; char five = '5'; char six = '6'; char seven = '7'; char eight = '8'; char nine = '9'; string ns = (nine + two + five).ToString(); int n = ((nine - '0') * 10 + two - '0') * 10 + five - '0'; * 10 + five - '0'; Console.WriteLine(n == ns); a)True b)False c)925 d)1850 e)Run-time error f)0 g)Compile time error
7
What will the following code result in? 7 char zero = '0'; char one = '1'; char two = '2'; char three = '3'; char four = '4'; char five = '5'; char six = '6'; char seven = '7'; char eight = '8'; char nine = '9'; string ns = (nine + two + five).ToString(); int n = ((nine - '0') * 10 + two - '0') * 10 + five - '0'; * 10 + five - '0'; Console.WriteLine(n.ToString() == ns); int type should be converted to string
8
What will the following code result in? 8 int i = 0x10; int j = 0x2; Console.WriteLine(i<<j); d)Compilation error e)32 f)64 a)1 b)2 c)Run-time error 16 2
9
What will the following code result in? 9 string str = @"\\//\""\'\"""; Console.WriteLine(str); e)\//"'" f)\\/"'" g)Compilation error h)Run-time error a)\\//\"\'\" b)\//"'" c)\/"'" d)\\//"'"
10
What will the following code result in? 10 double a = 0.2; decimal b = 0.3m; Console.WriteLine(a+b); d)Compilation error e)Run-time error a)0 b)0.5 c)null
11
What will the following code result in? 11 string a = "1"; long b = 1L; Console.WriteLine(b + a); d)2 e)Compilation error f)Run-time error a)11 b)11L c)1L1
13
What will the following code result in? 13 byte number = 0; for (int i = 0; i <= 32; i++) { number >>= i; number >>= i; for (int j = 0; j >= -32; j--) for (int j = 0; j >= -32; j--) { number <<= Math.Abs(j); number <<= Math.Abs(j); }}Console.WriteLine(number); e)2 f)255 g)Compilation error h)Run-time error a)0 b)1 c)True d)False 0 shifted left/right is always 0
14
What will the following code result in? 14 byte b1 = 1; int i1 = 2; int result1 = b1 << i1; int result2 = i1 << b1; int result3 = (i1 + b1) << (i1 - b1); Console.WriteLine("{0}, {1}, {2}", result1, result2, result3); result1, result2, result3); f)4, 4, 6 g)6, 6, 6 h)0, 0, 0 i)1, 1, 1 j)4, 4, 2 a)4, 6, 4 b)4, 6, 6 c)6, 6, 4 d)6, 4, 4 e)4, 4, 4
15
What will the following code result in? 15 double first = 0.0f; double second = 0.0; for (int i = 0; i < 12; i++) { first += 0.1; first += 0.1;} for (int i = 0; i < 4; i++) { second += 0.3; second += 0.3;}Console.WriteLine(first==second); a)1 b)0 c)2147483647 d)–2147483647 e)True f)False g)Compile time error h)3.402823E+38 i)-3.402823E+38 1.21.2
16
What will the following code result in? 16 int n1 = 4; int n2 = 6; int n3 = 8; int result1 = n1 ^ n2 & n3; int result2 = (n1 ^ n2) & n3; int result3 = n1 ^ (n2 & n3); bool equal12 = result1 == result2; bool equal13 = result1 == result3; bool equal23 = result2 == result3; Console.WriteLine("{0}, {1}, {2}", equal12, equal13, equal23); a)True, True, True b)True, True, False c)True, False, True d)True, False, False e)False, True, True f)False, False, True g)False, False, False h)False, True, False i)Compilation error j)Run-time error 100 110 1000 4 0 4 Bitwise AND has higher priority than bitwise XOR
17
What will the following code result in? 17 int a = 3; int b = 5; int result = a+++ ++b; Console.WriteLine("{0} {1} {2}", ++a, b++, --result); f)5 5 8 g)5 6 8 h)5 7 8 i)5 7 9 a)4 6 9 b)4 5 8 c)4 6 8 d)5 6 9 e)Compilation error
19
Indicate the correct statement for the following line of code? 19 Console.Write("Full line{0}", 1, 2); a)The next print operation will result in a run-time error b)The next print operation will start on the same line c)This is an invalid method call d)This print operation will cause run-time error e)This will cause compilation error f)There is no Write(…) method in the Console class
20
Which line of code should be used if we want to ensure that the decimal separator is ". "? 20 a)Console.OutputEncoding = Encoding.UTF8; b)Console.SetDecimalSeparator('.'); c)Console.DecimalSeparator = '.'; d)Console.CurrentCulture = CultureInfo.InvariantCulture; e)double.Parse(1.2); f)Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
21
What will Console.ReadLine() return when there aren't any available lines to read? a)"" b)"\0" c)'\0' d)null e)Compile time error f)Run-time error 21
22
How many consecutive intervals will be printed between the two digits (1 and 2) after the execution of the following code? 22 int a = 1; int b = 2; Console.Write("{0,-10}{1,10}", a, b); a)0 b)20 c)14 d)10 e)18 f)This code will cause run-time error
24
What will the following code result in? 24 bool isTrue = true; bool isFalse = false; if (!!(!(isTrue && isFalse) || !(isTrue || isFalse))) { Console.WriteLine(isFalse); Console.WriteLine(isFalse);}else{ Console.WriteLine(isTrue); Console.WriteLine(isTrue);} e)Compilation error f)Runtime error g)None of the answers a)false b)True c)true d)False
25
What will the following code result in? 25 int i = 1; int j = 1; switch (i) { case 1: case 1: i = 1; i = 1; break; break; case j: case j: i = 2; i = 2; break; break; case i: case i: i = 3; i = 3; break; break; default: default: i = 4; i = 4; break; break;}Console.WriteLine(i); a)1 b)2 c)3 d)4 e)Compilation error f)Run-time error g)None of the answers The case value must be a constant
26
What will the following code result in? 26 int number = 5; if (number++ == ++number) { Console.WriteLine(number + 1); Console.WriteLine(number + 1);}else{ Console.WriteLine(number + 2); Console.WriteLine(number + 2);} e)9 f)10 g)Compilation error h)Run-time error a)5 b)6 c)7 d)8
27
What will the following code result in? 27 int? number = new int?(); switch (number) { case 1: Console.Write(1); break; case 1: Console.Write(1); break; case 2: Console.Write(2); break; case 2: Console.Write(2); break; case 3: Console.Write(3); break; case 3: Console.Write(3); break; case null: Console.Write(4); break; case null: Console.Write(4); break; default: Console.Write(5); break; default: Console.Write(5); break;} a)1 b)2 c)3 d)4 e)Compilation error f)Run-time error g)None of the answers
29
What will the following code result in? 29 int count = 0; for (int i = 1, j = 2; i < j; i++, j++) { count++; count++; if (i == 3) i++; break; if (i == 3) i++; break;}Console.WriteLine(count); e)4 f)Compilation error g)Run-time error h)Endless loop a)0 b)1 c)2 d)3
30
What will be printed on the console when the following code is executed? 30 string[] elements = { "ab", "12" }; foreach (var e in elements) { foreach (var ch in e) foreach (var ch in e) { Console.Write(ch); Console.Write(ch); } Console.Write(e); Console.Write(e);} a)ab12 b)12ab c)abab1212 d)ab12ab12 e)12ab12ab f)Endless loop g)Run-time error h)Compilation error
31
What will the following code result in? 31 int n = 4, f = 0; do{ f *= n; f *= n; n--; n--;} while (n > 0); Console.WriteLine(f); f)120 g)Compilation error h)Run-time error i)Endless loop a)0 b)4 c)6 d)12 e)24
32
What will the following code result in? 32 for (int i = 1; i <= 4; i = i * 2) { Console.Write(i + " "); Console.Write(i + " ");} f)1 2 4 g)Compilation error h)Run-time error i)Endless loop a)1 2 b)2 4 6 c)2 4 8 d)1 2 3 e)1 2 3 4
33
What will the following code result in? 33 int sum = 0; while (sum < 10) for (int i = 0; i <= 2; i++) for (int i = 0; i <= 2; i++) sum += i; sum += i;Console.WriteLine(sum); e)12 f)Compilation error g)Run-time error h)Endless loop a)0 b)9 c)10 d)11
34
*** Try your luck! What will be written on the console when the following code is executed? 34 int toto = 1; for (int i = 2; i <= 4; i++, toto++) { for (int j = i - 1; j < i + 1; j += 2, toto += i < j ? 1 : -1) for (int j = i - 1; j < i + 1; j += 2, toto += i < j ? 1 : -1) { toto <<= 2; toto <<= 2; }} Console.WriteLine(toto - 57); e)6 f)35 g)42 h)49 a)-49 b)-42 c)-35 d)5
35
форум програмиране, форум уеб дизайн курсове и уроци по програмиране, уеб дизайн – безплатно програмиране за деца – безплатни курсове и уроци безплатен SEO курс - оптимизация за търсачки уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop уроци по програмиране и уеб дизайн за ученици ASP.NET MVC курс – HTML, SQL, C#,.NET, ASP.NET MVC безплатен курс "Разработка на софтуер в cloud среда" BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране, книги – безплатно от Наков безплатен курс "Качествен програмен код" алго академия – състезателно програмиране, състезания ASP.NET курс - уеб програмиране, бази данни, C#,.NET, ASP.NET курсове и уроци по програмиране – Телерик академия курс мобилни приложения с iPhone, Android, WP7, PhoneGap free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране http://academy.telerik.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.