Part I C# Programming Basis
1. int a=10, int b=15. Please write a piece of code to swap a and b without using a third variable. (10)
2. There is an array int[] max={6,5,2,9,7,4,0}. Please implement a Quick Sort method to sort this array order by descendent, and return the sorted array. (15)
3. There are 2 sentences. Please implement a function to find out the words in one sentence that does not appear in the another one. (15)
4. Write Unit Test Cases for the C# function you have written for Question 3 above, using NUnit or Visual Studio Unit Test Framework. (20)
5. Read the following C# code, and write out what the output expected. (10)
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
A objA = new A();
B objB = new B();
C objC = new C();
Console.WriteLine(objA.i);
Console.WriteLine(objB.i);
Console.WriteLine(objC.i);
objC.Dummy();
Console.WriteLine(objA.i);
Console.WriteLine(objB.i);
Console.WriteLine(objC.i);
Console.Read();
}
}
public class A
{
public int i = 1;
public A() { }
}
public class B : A
{
public B()
{
i++;
}
}
public class C : B
{
public C()
{
i++;
}
public void Dummy()
{
A a = new A();
i = a.i;
}
}
}
Part II SQL Programming
6. Write a SQL stored procedure in MS SQL Server 2005 to retrieve data from a single table and return paged result by assigned page index, using the new feature of SQL Server 2005. (10)
7. Look at the following data table, then write a SQL query. It should return a result containing the max score of each course in the class, including all fields of the table in the result returned. (15)1.
id | class | student | course | score |
1 | 1 | Tom | English | 83 |
2 | 1 | Jack | English | 95 |
3 | 1 | Scott | English | 79 |
4 | 1 | Mary | English | 88 |
5 | 1 | Tom | Chinese | 60 |
6 | 1 | Jack | Chinese | 72 |
7 | 1 | Scott | Chinese | 91 |
8 | 1 | Mary | Chinese | 86 |
9 | 1 | Tom | Computer | 100 |
10 | 1 | Jack | Computer | 100 |
11 | 1 | Scott | Computer | 89 |
12 | 1 | Mary | Computer | 82 |
Part III Thinking Training
8. 有一个工人7天的薪水刚好是一根金条。老板想用金条来支付该员工的薪水,并且每天支付当天的薪水。老板只是将每根金条切了2刀就做到了。请问,老板是如何做到的?(10)
Part IV OOD&OOP
9. Implement a Singleton pattern class using C#. (15)
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13651903/viewspace-1044450/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13651903/viewspace-1044450/