Microsoft Programming in C# - 070-483 Exam Practice Test
Question 1
You are modifying an existing application.
The application includes a Loan class and a Customer class. The following code segment defines the classes.

You populate a collection named customer-Collection with Customer and Loan objects by using the following code segment:

You create a largeCustomerLoans collection to store the Loan objects by using the following code segment:
Collection<Loan> largeCustomerLoans = new Collection<Loan>();
All loans with an Amount value greater than or equal to 4000 must be tracked.
You need to populate the largeCustomerLoans collection with Loan objects.
Which code segment should you use?

The application includes a Loan class and a Customer class. The following code segment defines the classes.

You populate a collection named customer-Collection with Customer and Loan objects by using the following code segment:

You create a largeCustomerLoans collection to store the Loan objects by using the following code segment:
Collection<Loan> largeCustomerLoans = new Collection<Loan>();
All loans with an Amount value greater than or equal to 4000 must be tracked.
You need to populate the largeCustomerLoans collection with Loan objects.
Which code segment should you use?

Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 2
You are developing a C# application. The application references and calls a RESTful web service named EmployeeService. The EmployeeService web service includes a method named GetEmployee which accepts an employee ID as a parameter. The web service returns the following JSON data from the method.


Which code segment should you use?
A)

B)

C)

D)



Which code segment should you use?
A)

B)

C)

D)

Correct Answer: C
Question 3
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have the following C# code. (Line numbers are included for reference only.)

You need the foreach loop to display a running total of the array elements, as shown in the following output.
1
3
6
10
15
Solution: You insert the following code at line 02:

Does this meet the goal?
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have the following C# code. (Line numbers are included for reference only.)

You need the foreach loop to display a running total of the array elements, as shown in the following output.
1
3
6
10
15
Solution: You insert the following code at line 02:

Does this meet the goal?
Correct Answer: A
Question 4
You are developing an application.
You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer.
Which type of delegate should you use?
You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer.
Which type of delegate should you use?
Correct Answer: D
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 5
You have an application that uses paging. Each page displays 10 items from a list.
You need to display the third page. (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)

You need to display the third page. (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)

Correct Answer:

Explanation:
Note:
Skip the first two page (first 20 items) then select the next page (next 10 items),
* Use the Take operator to return a given number of elements in a sequence and then skip over the remainder.
Use the Skip operator to skip over a given number of elements in a sequence and then return the remainder.
Question 6
You are developing an application that will transmit large amounts of data between a client computer and a server. You need to ensure the validity of the data by using a cryptographic hashing algorithm. Which algorithm should you use?
Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 7
You are developing code for an application that retrieves information about Microsoft .NET Framework assemblies.
The following code segment is part of the application (line numbers are included for reference only):

You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly.
Which code segment should you insert at line 04?
The following code segment is part of the application (line numbers are included for reference only):

You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly.
Which code segment should you insert at line 04?
Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 8
You are developing an application that will transmit large amounts of data between a client computer and a server. You need to ensure the validity of the data by using a cryptographic hashing algorithm. Which algorithm should you use?
Correct Answer: B
Question 9
You are evaluating a method that calculates loan interest. The application includes the following code segment. (Line numbers are included for reference only.)

When the loanTerm value is 5 and the loanAmount value is 4500, the loanRate must be set to 6.5 percent.
You need to adjust the loanRate value to meet the requirements.
What should you do?

When the loanTerm value is 5 and the loanAmount value is 4500, the loanRate must be set to 6.5 percent.
You need to adjust the loanRate value to meet the requirements.
What should you do?
Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 10
A developer designs an interface that contains the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.


For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Correct Answer:

Question 11
You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?


You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 12
You are developing an application by using C#. The application will process several objects per second.
You need to create a performance counter to analyze the object processing.
Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)

You need to create a performance counter to analyze the object processing.
Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)

Correct Answer:

1 - Create a CounterCreationDataCollection collection. Then create the counters as CounterCreationData objects and set the necessary properties.
2 - Add the CounterCreationData objects to the collection by calling the Add() method of the collection.
3 - Call the Create() method of the PerformanceCounterCategory class and pass the collection to the method.
Explanation:
CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection(); // Box1
// Add the counter. Box 1
CounterCreationData averageCount64 = new CounterCreationData();
averageCount64.CounterType = PerformanceCounterType.AverageCount64;
averageCount64.CounterName = "AverageCounter64Sample";
counterDataCollection.Add(averageCount64);
// Add the base counter.
CounterCreationData averageCount64Base = new CounterCreationData();
averageCount64Base.CounterType = PerformanceCounterType.AverageBase;
averageCount64Base.CounterName = "AverageCounter64SampleBase";
counterDataCollection.Add(averageCount64Base); // Box 2
// Create the category. Box 3
PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
"Demonstrates usage of the AverageCounter64 performance counter type.", PerformanceCounterCategoryType.SingleInstance, counterDataCollection);
Question 13
You are developing an application in C#.
The application uses exception handling on a method that is used to execute mathematical calculations by using integer numbers.
You write the following catch blocks for the method (line numbers are included for reference only):

You need to add the following code to the method:

At which line should you insert the code?
The application uses exception handling on a method that is used to execute mathematical calculations by using integer numbers.
You write the following catch blocks for the method (line numbers are included for reference only):

You need to add the following code to the method:

At which line should you insert the code?
Correct Answer: A
Question 14
You are developing a Windows Forms (WinForms) application. The application displays a TreeView that has 1,000 nodes.
You need to ensure that if a user expands a node, and then collapses the TreeView, the node object is kept in memory unless the Garbage Collector requires additional memory.
Which object should you use to store the node?
You need to ensure that if a user expands a node, and then collapses the TreeView, the node object is kept in memory unless the Garbage Collector requires additional memory.
Which object should you use to store the node?
Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 15
You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:

The application must meet the following requirements:
* When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
* When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)


The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:

The application must meet the following requirements:
* When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
* When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Correct Answer:

Explanation:
Catch the most specific exception first.

