98-361 | Download MTA 98-361 practice test


Q1. You are developing a C# program. You write a recursive method to calculate the factorial of a number. Which of the following code segment should you use to generate correct results? 

A. public static int Factorial(int n) 

if (n == 0) 

return 1; 

else 

return n * Factorial(n - 1); 

B. public static int Factorial(int n) 

if (n == 0) 

return 1; 

else 

return (n – 1) * Factorial(n); 

C. public static int Factorial(int n) 

if (n == 0) 

return n; 

else 

return Factorial(n - 1); 

D. public static int Factorial(int n) 

return n * Factorial(n - 1); 

Answer:

Q2. You are C# developer who is developing a Windows application. You need to provide a common definition of a base class that can be shared by multiple derived classes. Which keyword should you use to declare the new class? 

A. virtual 

B. sealed 

C. interface 

D. abstract 

Answer:

Q3. You are updating an existing Windows Forms application. The form hosts a DateTimePicker control named dateTimePicker1. You need to write code that executes when the value of the dateTimePicker1 control is changed. You write a method, ProcessValueChanged, that contains the code you want to execute. What code should you write to invoke the ProcessValueChanged method? Any code that your write must not affect existing functionality of the application. 

A. dateTimePicker1.ValueChanged += new System.EventHandler( ProcessValueChanged); 

B. dateTimePicker1.ValueChanged = new System.EventHandler( ProcessValueChanged); 

C. dateTimePicker1.Value += new System.EventHandler( ProcessValueChanged); 

D. dateTimePicker1.Value = new System.EventHandler( ProcessValueChanged); 

Answer:

Q4. You are creating a new class named Sphere derived from the Shape class. The Shape class has the following code: 

class Shape 

public virtual void Area() 

// additional code... 

The Area method in the Shape class should provide new functionality but also hide the Shape class implementation of the Area method. Which code segment should you use to accomplish this? 

A. class Sphere : Shape 

public override void Area() 

// additional code ... 

B. class Sphere : Shape 

public new void Area() 

// additional code ... 

C. class Sphere : Shape 

public virtual void Area() 

// additional code ... 

D. class Sphere : Shape 

public static void Area() 

// additional code ... 

Answer:

Q5. You are developing a C# application. You create a class of the name Widget. You use some third-party libraries, one of which also contains a class of the name Widget. You need to make sure that using the Widget class in your code causes no ambiguity. Which C# keyword should you use to address this requirement? 

A. namespace 

B. override 

C. delegate 

D. class 

Answer:

Q6. You are planning to develop a new software system for your organization. You need to verify that the implementation of the system matches with the requirements of the system. Which of the following activities would accomplish this requirement? 

A. testing 

B. design 

C. release 

D. requirements analysis 

Answer:

Q7. You are planning to develop a new software system for your organization. You need to review the plans, models, and architecture for how the software will be implemented. Of which of the following activities should you review the output? 

A. requirements analysis 

B. design 

C. coding 

D. testing 

Answer:

Q8. You are developing an algorithm for a retail Web site. You need to calculate discounts on certain items based on the quantity purchased. You develop the following decision table to calculate the discount: 

If a customer buys 50 units of an item, what discount will be applicable to the purchase? 

A. 5 percent 

B. 10 percent 

C. 15 percent 

D. 20 percent 

Answer:

Q9. You are writing code for a class named Book. You should be able to get a list of all books sorted by the author’s last name. You need to write code to define this behavior of a class. Which of the following class elements should you use? 

A. method 

B. property 

C. event 

D. delegate 

Answer:

Q10. You are developing an ASP.NET appilcation using C#. You create a code-behind class named Status that contains the business logic. This class is under the namespace Northwind and is stored in a file named status. aspx.cs. You need to writebthe user interface code that uses this class. Whitch of the following cod segments should you use? 

A. <% Page Language="c#" Codebehined="status.aspx.cs" ClassName="Northwind.Status"%> 

B. <% Page Language="c#" Codebehined="status.aspx.cs" Inherits="Northwind.Status" %> 

C. <% Page Language="c#" Src="status.aspx.aspx.cs" Inherits="Northwind.Status" %> 

D. <% Page Language="c#" Src="status.aspx.aspx.cs" ClassName="Northwind.Status" %> 

Answer: