70-483 - Programming in C#

Go back to Microsoft

Exam FAQ

How much does the 70-483 exam cost? What is the best way to study for the 70-483 exam?

Example Questions

You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.) 01 public delegate void AddBookCallback(int i); 02 public class BookTracker 03 { 04 List<Book> books = new List<Book>(); 05 public void AddBook(string name, AddBookCallback callback) 06 { 07 books.Add(new Book(name)); 08 callback(books.Count); 09 } 10 } 11 12 public class Runner 13 { 14 15 BookTracker tracker = new BookTracker(); 16 public void Add(string name) 17 { 18 19 } 20 } You need to add a book to the BookTracker instance. What should you do? You are developing an application by using C#. The application includes an object that performs a long running process. You need to ensure that the garbage collector does not release the object's resources until the process completes. Which garbage collector method should you use? You work as a senior developer at YourCompany.com. The YourCompany.com network consists of a single domain named YourCompany.com. You are running a training exercise for junior developers. You are currently discussing a method of the StreamReader class that creates a shallow copy of the existing Object. Which of the following is the method being discussed? You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.) 01 public DateTime? OrderDate; 02 IQueryable<Order> LookupOrdersForYear(int year) 03 { 04 using (var context = new NorthwindEntities()) 05 { 06 var orders = 07 from order in context.Orders 08 09 select order; 10 return orders.ToList().AsQueryable(); 11 } 12 } The application must meet the following requirements: return only orders that have an OrderDate value other than null. return only orders that were placed in the year specified by the method year parameter not raise an exception You need to ensure that the application meets the requirements. Which code segment should you insert at line 08? You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to develop the application along with a team of developers, graphic designers, and content designers. Some of your team members do not have Microsoft Visual Studio 2008 installed on their computers. You need to ensure that Visual Studio 2008 can automatically recognize new graphics, content, and other media files that are added to the project. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application displays a price list that contains 100 items. The customers use desktop computers, PDAs, mobile phones, or other mobile devices to access the application. The application uses a master page that includes the following layout: - A site header at the top of the page. - A navigation structure at the side of the page. - Content on the remaining space on the page. You need to ensure optimal rendering of the price list for each customer, irrespective of the device category used. What should you do? You are creating a new collection type and you want to make sure the elements in it can be easily accessed. What should you add to the type? You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in the application. You add a TextBox control and a Button control to the form. When the user clicks the Button contro the input text from the TextBox control is stored in a database. You also add a Validation control to the form to verify whether the input data is valid before it is stored in the database. You discover that users who have Javascript disabled in their Web browsers can store invalid data in the database. You need to ensure that only valid data is submitted to the database. What should you do? You are developing an application that includes the following code segment. (Line numbers are included for reference only.) 01 using System; 02 class MainClass 03 { 04 public static void Main(string[] args) 05 { 06 bool bValidInteger = false; 07 int value = 0; 08 do 09 { 10 Console.WriteLine("Enter an integer"); 11 bValidInteger = GetValidInteger(ref value); 12 } while (!bValidInteger); 13 Console.WriteLine("You entered a valid integer, " + value); 14 } 15 public static bool GetValidInteger(ref int val) 16 { 17 string sLine = Console.ReadLine(); 18 int number; 19 20 { 21 return false; 22 } 23 else 24 { 25 val = number; 26 return true; 27 } 28 } 29 } You need to ensure that the application accepts only integer input and prompts the user each time non-integer input is entered. Which code segment should you add at line 19? You are creating an ASP.NET application by using the .NET Framework 3.5. The application will reference a third-party component. The component might throw an unhandled exception from a background thread, causing the ASP.NET worker process to be terminated. You need to ensure that any unhandled exceptions are logged before the application terminates. What should you do? You need to iterate over a collection in which you know the number of items. You need to remove certain items from the collection. Which statement do you use? You are creating ASP.NET applications by using the .NET Framework 3.5. The application occasionally experiences errors that cannot be reproduced on a test environment. You need to ensure that the application meets the following requirements: - All unexpected errors are logged. - Logging is configured with a minimum amount of modification to the application code. What should you do? You are creating ASP.NET applications by using the .NET Framework 3.5. The application has two tables named Products and ProductPrice. The application retrieves and stores data from the Product table into a Dataset object. The application uses the DataSet object to modify and update the data that is retrieved. The update command for the related SqlDataAdapter class is generated automatically by using a SqlCommandBuilder object. You plan to retrieve and modify data from the Product and ProductPrice tables as a unit. You need to ensure that the application can update the data in the tables. What should you do? You are developing an application that produces an executable named MyApp.exe and an assembly named MyApp.dll. The application will be sold to several customers. You need to ensure that enough debugging information is available for MyApp.exe, so that if the application throws an error in a customer's environment, you can debug the error in your own development environment. What should you do? You are creating A5P.NET applications by using the .NET Framework 3.5. The application uses the DataSet and DataAdapter classes to retrieve and update data. Data can be stored in Microsoft SQL Server 2008 databases or in Microsoft Access databases. You are designing a strategy that allows the application to function appropriately regardless of the database management systems used. You need to implement the strategy by using the minimum amount of development effort. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application accesses a Windows Communication Foundation (WCF) service. You plan to debug the application. You need to ensure that you can step into the WCF service and debug the application. What should you do? You work as a senior developer at YourCompany.com. The YourCompany.com network consists of a single domain named YourCompany.com. You are running a training exercise for junior developers. You are currently discussing the reason for adding the lockObject private object to a class. Which of the following best describes this reason? You are developing an application that will process personnel records. The application must encrypt highly sensitive data. You need to ensure that the application uses the strongest available encryption. Which class should you use? You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses a control that is bound to a Data Source control. You write code that modifies the parameters for the query used by the Data Source control. Which event should you override? An application includes a class named Person. The Person class includes a method named GetData. You need to ensure that the GetData() method can be used only by the Person class or a class derived from the Person class. Which access modifier should you use for the GetData() method? You are developing an assembly that will be used by multiple applications. You need to install the assembly in the Global Assembly Cache (GAC). Which two actions can you perform to achieve this goal? (Each correct answer presents a complete solution. Choose two.) You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores and retrieves sensitive data in a Microsoft SQL Server 2008 database. The database is accessed by multiple applications. You need to ensure that other applications that access the database are unable to view any sensitive data that is stored by the application. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. A Web form in the application needs to call a Web service. You place the following code segment in the Page_l_oad event of the form. AddOnPreRenderCornpleteAsync ( new BeginEventHandler (BecrinCallWebService) , new EndEventHandler(EndCallWebService) ); You need to ensure that the BeginCallWebService and EndCallWebService routines are called when the page is accessed. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to deploy the application. You need to ensure that the names of the generated assemblies conform to the rules specified by the deployment environment. What should you do? You create an ASP.NET application by using the .NET Framework 3.5. The application must be deployed by using the http://www.contoso.com/ URL. The application contains several Web forms. You plan to implement Really Simple Syndication (RSS) feeds functionality. The RSS feeds will be consumed by using the http://www.contoso.com/News.rss URL. You need to ensure that the application displays the RSS-formatted information when accessing the specified URL. What should you do? You are creating an ASP.NET application by using Microsoft .NET Framework 3.5. The application is a library application that catalogs subjects and books. The application contains 45 Microsoft 70-564 Exam a DataContext object named Subjects and a related line of business object named Books. The Subjects DataContext object is queried by using the following LINQ query. var query = Iroro subject in Subjects where '. ( subject.Books .All(b => b.Price < = 25 && price >= 20)) select subject; You need to find out the results that will be returned from the query. What is the result of the query? You need to create a method that can be called by using a varying number of parameters. What should you use? You are developing an application by using C#. You have the following requirements: -Support 32-bit and 64-bit system configurations. -Include pre-processor directives that are specific to the system configuration. -Deploy an application version that includes both system configurations to testers. -Ensure that stack traces include accurate line numbers. You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) You are creating an ASP.NET application by using the .NET Framework 3.5. You deploy the application on multiple servers in the same domain. All servers belong to the same Web farm. You need to ensure that users have to log on only once to gain access to all the servers. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) You are creating an ASP.NET application by using the .NET Framework 3.5. You create a custom Web server control to implement the shopping cart functionality in the application. You add the following code fragment to the Web.config file of the application. <authentication mode="None" /> < sessionState mode=" SQLServer " /> You need to ensure that when the user re-opens the Web browser, the application retains the state of the shopping cart. Which state management strategy should you use? You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be used to share photos across the Internet. Each photo must be available in various sizes and formats. The users can access the application from different browsers and operating systems. You need to develop a download feature that can be easily maintained. You also need to ensure that only a single version of each photo is stored on the server. What should you do? You are developing a method named CreateCounters that will create performance counters for an application. The method includes the following code. (Line numbers are included for reference only.) 01 void CreateCounters() 02 { 03 if (!PerformanceCounterCategory.Exists("Contoso")) 04 { 05 var counters = new CounterCreationDataCollection(); 06 var ccdCounter1 = new CounterCreationData 07 { 08 CounterName = "Counter1", 09 CounterType = PerformanceCounterType.AverageTimer32 11 }; 12 counters.Add(ccdCounter1); 13 var ccdCounter2 = new CounterCreationData 14 { 15 CounterName = "Counter2", 16 17 }; 18 counters.Add(ccdCounter2); 19 PerformanceCounterCategory.Create("Contoso", "Help string", 20 PerformanceCounterCategoryType.MultiInstance, counters); 21 } 22 } You need to ensure that Counter2 is available for use in Windows Performance Monitor (PerfMon). Which code segment should you insert at line 16? You are implementing a new method named ProcessData. The ProcessData() method calls a third-party component that performs a long-running operation. The third-party component uses the IAsyncResult pattern to signal completion of the long-running operation. You need to ensure that the calling code handles the long-running operation as a System.Threading.Tasks.Task object. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) You need to validate an XML file. What do you use? You are creating an ASP.NET application by using the .NET Framework 3.5. The application must access a Microsoft SQL Server 2008 database. The database and the ASP.NET application are located on two different servers. The two servers are located on networks separated by a firewall. Only port 80 and port 443 are open through the firewall. You need to ensure that the application can access the database. What should you do? You are debugging an application that calculates loan interest. The application includes the following code. (Line numbers are included for reference only.) 01 private static decimal CalculateInterest(decimal loanAmount, int loanTerm, decimal loanRate) 02 { 03 04 decimal interestAmount = loanAmount * loanRate * loanTerm; 05 06 return interestAmount; 07 } You need to ensure that the debugger breaks execution within the Calculatelnterest() method when the loanAmount variable is less than or equal to zero in all builds of the application. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application will use multiple master pages. Each master page will have an Image control named ImageControl1. ImageControl1 will be added directly to some master pages and through a user control to the other master pages. You need to ensure that the content pages of the application can dynamically reference the image displayed by ImageControl1. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) You use the Task.Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion. If the data processing operation fails, a second operation must clean up any results of the first operation. You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores sensitive profile data in a Microsoft SQL Server 2008 database. You need to ensure that no profile data is stored in clear text. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses Forms authentication. Your company uses Active Directory. You plan to modify the application to enable users to use their existing Active Directory account to access the application through the Internet. You need to ensure that the application is modified by using the minimum amount of user interface changes, cost, and development effort. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. The application will run on a web farm with no server affinity. Users access the web site daily. You are designing a strategy for persisting user search history. You need to ensure that a user's search history is persisted from one day to the next. What should you do? You need to store the values in a collection. The solution must meet the following requirements: • The values must be stored in the order that they were added to the collection. • The values must be accessed in a first-in, first-out order. Which type of collection should you use? You work as a developer at YourCompany.com. The YourCompany.com network consists of a single domain named YourCompany.com. You have been tasked with creating an application for YourCompany.com. The written code includes a sealed class. Which of the following is TRUE with regards to sealed classes? (Choose all that apply.) You are creating an ASP.NET application by using the .NET Framework 3.5. The organization uses an Active Directory Application Mode (ADAM) server to store user names, passwords, and role membership information. You need to configure the application to access the role information for authenticated users. You also need to accomplish this goal by using the minimum amount of development effort. What should you do? You are creating an ASP.NET application by using the .NET Framework 3.5. You use LINQ to SQL to query a Microsoft SQL Server 2008 database. You need to create a LINQ query to retrieve information on order and order details. You need to ensure that the LINQ query executes the following SQL statement: SELECT Order.OrderID , Order.Description , OrderDetails.UnitPrice FROM Order JOIN OrderDetails ON Order.OrderID = OrderDetails.OrderID Which LINQ query should you use? You are modifying an existing application that manages employee payroll. The application includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll database and processes batches of paychecks once a week. You need to ensure that the PayrollProcessor class supports iteration and releases database connections after the batch processing completes. Which two interfaces should you implement? (Each correct answer presents part of the complete solution. Choose two.) You work as a developer at YourCompany.com. The YourCompany.com network consists of a single domain named YourCompany.com. You have received instructions to create a new application for YourCompany.com. The code must allow for certain string input data to be validated via the Regex class. Which of the following is TRUE with regards to the Regex class? collection of Order objects. The collection must meet the following requirements: -Use strongly typed members. -Process Order objects in first-in-first-out order. -Store values for each Order object. -Use zero-based indices. You need to use a collection type that meets the requirements. Which collection type should you use? You work as a developer at YourCompany.com. The YourCompany.com network consists of a single domain named YourCompany.com. You have been tasked with creating an application allows users to enter time and dates. You are writing code that includes a DateTime method, which converts the indicated string representation of a date and time to its DateTime equivalent using the specified format, culture-specific format information, and style. The method requires the format of the string representation to match the specified format exactly. The method then returns a value that indicates whether the conversion was successful. Which of the following is the DateTime method that is being included? You are creating an ASP.NET application by using the .NET Framework 3.5. The application must dynamically build the user interface. You need to initialize the dynamically added controls so that they are accessible during the lifetime of the page. You also need to ensure that the page code can handle the PostBack events for the controls. What should you do?

Study Guides