Q1. You are writing a method named PrintReport that doesn't return a value to the calling code. Which keyword should you use in your method declaration to indicate this fact?
A. void
B. private
C. int
D. string
Answer: A
Q2. You are developing an application that manages customers and their orders. Any solution that you develop must take the least amount of effort but offer the best performance.. Which of the following situations is not a good candidate for implementation with stored procedures in your application?
A. Retrieving the list of all customers in the database
B. Retrieving the list of all orders for particular customers
C. Inserting a new order into the Orders table
D. Ad hoc querying by the database administrator
Answer: D
Q3. You are developing a Web page for a medium-sized business. You want to separate the formatting and layout of the page from its content. Which of the following technologies should you use to define the formatting and layout of the page content?
A. Cascading Style Sheet (CSS)
B. Hypertext Markup Language (HTML)
C. JavaScript
D. Hypertext Transmission Protocol (HTTP)
Answer: A
Q4. You write large amount of JavaScript code for your Web site. You need to take advantage of caching techniques to make sure that Web pages load as quickly as possible. You also need to ensure that you can modify the JavaScript code with the least amount of effort. What should you do?
A. Write JavaScript code inside the <SCRIPT> tag. Include the <SCRIPT> within the <HEAD> tag of theHTML page.
B. Write JavaScript code inside the <SCRIPT> tag. Include the <SCRIPT> within the <BODY> tag of theHTML page.
C. Write JavaScript code inside a separate file. Use the SRC attribute of the <SCRIPT> tag to link to theJavaScript file.
D. Write JavaScript code inside a separate file. Use the HREF attribute of the <LINK> tag to link to theJavaScript file.
Answer: C
Q5. You are developing a C# program. You write the following code:
01: int count = 0;
02: while (count < 5)
03: {
04: if (count == 3)
05: break;
06: count++;
07: }
How many times will the control enter the while loop?
A. 5
B. 4
C. 3
D. 2
Answer: B
Q6. You are developing an application that stores data in SQL Server 2005 database. You need to write a query that retrieves all orders in the orders table that were placed on January 1, 2011. You write the following query:
SELECT * FROM Orders
WHERE OrderDate = 01/01/2011
The statement executes without any error but does not return any data. You are certain that the database contains order from this date. How should you correct the SQL statement?
A. SELECT * FROM Orders
WHERE OrderDate = #01/01/2011#
B. SELECT * FROM Orders
WHERE OrderDate = %01/01/2011%
C. SELECT * FROM Orders
WHERE OrderDate = '01/01/2011'
D. SELECT * FROM Orders
WHERE OrderDate = "01/01/2011"
Answer: C
Q7. Your application needs to store the customer list in a text file. You want to minimize the size of this disk file and be able to open it in common text editors. Which of the following classes should you use to write the file?
A. StreamReader
B. StreamWriter
C. BinaryWriter
D. XmlWriter
Answer: B
Q8. You need to gain a better understanding of the solution before writing the program. You decide to develop an algorithm that lists all necessary steps to perform an operation in the correct order. Any technique that you use should minimize complexity and ambiguity. Which of the following techniques should you use?
A. flowchart
B. decision table
C. C# program
D. A paragraph in English
Answer: A
Q9. You are developing a new application that optimizes the processing of a manufacturing plant’s operations. You need to implement a data structure that works as a “buffer” for overflow capacity. When the manufacturing capacity is available, the items in the buffer need to be processed in the order in which they were added to the buffer. Which data structure should you use to implement such buffer?
A. array
B. linked list
C. stack
D. queue
Answer: D
Q10. You are reviewing a C# program. The program contains the following class:
public struct Rectangle { public double Length {get; set;} public double Width { get; set; } }
The program executes the following code as part of the Main method:
Rectangle r1, r2;
r1 = new Rectangle { Length = 10.0, Width = 20.0 };
r2 = r1;
r2.Length = 30;
Console.WriteLine(r1.Length);
What will be the output when this code is executed?
A. 10
B. 20
C. 30
D. 40
Answer: A