98-361 | Regenerate 98-361 Exam Study Guides With New Update Exam Questions


Q11. You are creating a new class named Polygon. You write the following code: 

class Polygon : IComparable 

public double Length { get; set; } 

public double Width { get; set; } 

public double GetArea() 

return Length * Width; 

public int CompareTo(object obj) 

// to be completed 

You need to complete the definition of the CompareTo method to enable comparison of the Polygon objects. 

Which of the following code segments should you use? 

A. public int CompareTo(object obj) 

Polygon target = (Polygon)obj; 

double diff = this.GetArea() - target.GetArea(); 

if (diff == 0) 

return 0; 

else if (diff > 0) 

return 1; 

else return -1; 

B. public int CompareTo(object obj) 

Polygon target = (Polygon)obj; 

double diff = this.GetArea() - target.GetArea(); 

if (diff == 0) 

return 1; 

else if (diff > 0) 

return -1; 

else return 0; 

C. public int CompareTo(object obj) 

Polygon target = (Polygon)obj; 

if (this == target) 

return 0; 

else if (this > target) 

return 1; 

else return -1; } 

D. public int CompareTo(object obj) 

Polygon target = (Polygon)obj; 

if (this == target) 

return 1; 

else if (this > target) 

return -1; 

else return 0; 

Answer:

Q12. 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:

Q13. You are planning to develop a new software system for your organization. You need to review the system’s technical blueprint. Which of the following participants is responsible for providing the technical blueprint? 

A. user interface designer 

B. developer 

C. architect 

D. technical writer 

Answer:

Q14. You are developing an application that uses a double dimensional array. You use the following code to declare the array: 

int[,] numbers = new int[,] 

{ 11, 7, 50, 45, 27 }, 

{ 18, 35, 47, 24, 12 }, 

{ 89, 67, 84, 34, 24 }, 

{ 67, 32, 79, 65, 10 } 

}; 

Next, you refer to an array element by using the expression numbers[2, 3]. What will be the return value of this expression? 

A. 47 

B. 84 

C. 24 

D. 34 

Answer:

Q15. Your application includes a SqlDataAdapter object named sqlDataAdapter and an OleDbDataAdapter object named oledbdataAdapter. You need to connect to the Employees table of a SQL Server database. Your application also includes a DataSet object named dsEmployees. You need to load the data from the database into the DataSet object. You must select a solution that gives you the best performance. Which of the following lines of code should you choose? 

A. dsEmployees = sqlDataAdapter.Fill(“Employees”); 

B. dsEmployees = oledbDataAdapter.Fill(“Employees”); 

C. oledbDataAdapter.Fill(dsEmployees, "Employees"); 

D. sqlDataAdapter.Fill(dsEmployees, “Employees”); 

Answer:

Q16. 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

Q17. You are invoking a Web service method that returns an ArrayList object. The client application is written is C#, whereas the Web service is written in Visual Basic. The Web service is outside your corporate firewall. You receive an "object not found" error when you call the method that returns the ArrayList object but can call other methods successfully from the same Web service. What could be the problem? 

A. The client and the Web service are not written in the same programming language. 

B. The firewall is blocking all SOAP calls. 

C. The client project does not contain a reference to the System.Collection namespace. 

D. The ArrayList class cannot be serialized. 

Answer:

Q18. You have developed a Windows Forms application that stockbrokers will use. The stockbrokers need to view data for multiple stocks at the same time. You need to change the display and behavior of a Windows Form so that it can contain multiple child windows. What should you do? 

A. Set the IsMdiChild property of the form. 

B. Set the MdiParent property for all the child windows. 

C. Set the MdiChild property of the form. 

D. Set the IsMdiContainer property of the form to true. 

Answer:

Q19. You are writing code to handle events in your program. You define a delegate named PolygonHandler like this: 

public delegate void PolygonHandler(Polygon p); 

You also create a variable of the PolygonHandler type as follows: 

PolygonHandler handler; 

Later in the program, you need to add a method named CalculateArea to the method invocation list of the handler variable. The signature of the CalculateArea method matches the signature of the PolygonHandler method. Any code that you write should not affect any existing event-handling code. Given this restriction, which of the following code lines should you write? 

A. handler = new PolygonHandler(CalculateArea); 

B. handler = CalculateArea; 

C. handler += CalculateArea; 

D. handler -= CalculateArea; 

Answer:

Q20. You are developing an algorithm before you write the C# program. You need to perform some calculations on a number. You develop the following flowchart for the calculation: 

If the input value of n is 5, what is the output value of the variable fact according to this flowchart? 

A. 720 

B. 120 

C. 24 

D. 6 

Answer: