Microsoft 70-483 Exam Practice Questions (P. 5)
- Full Access (271 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #21
You are modifying an application that processes leases. The following code defines the Lease class. (Line numbers are included for reference only.)

Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years.
You need to implement the notification mechanism.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)


Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years.
You need to implement the notification mechanism.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

send
light_mode
delete
Question #22
You are developing an application that uses structured exception handling. The application includes a class named ExceptionLogger.
The ExceptionLogger class implements a method named LogException by using the following code segment: public static void LogException(Exception ex)
You have the following requirements:
✑ Log all exceptions by using the LogException() method of the ExceptionLogger class.
✑ Rethrow the original exception, including the entire exception stack.
You need to meet the requirements.
Which code segment should you use?

The ExceptionLogger class implements a method named LogException by using the following code segment: public static void LogException(Exception ex)
You have the following requirements:
✑ Log all exceptions by using the LogException() method of the ExceptionLogger class.
✑ Rethrow the original exception, including the entire exception stack.
You need to meet the requirements.
Which code segment should you use?

- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
A
Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.
References: http://msdn.microsoft.com/en-us/library/ms182363(v=vs.110).aspx
A
Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.
References: http://msdn.microsoft.com/en-us/library/ms182363(v=vs.110).aspx
send
light_mode
delete
Question #23
You are developing an application that includes a class named UserTracker. The application includes the following code segment. (Line numbers are included for reference only.)

You need to add a user to the UserTracker instance.
What should you do?


You need to add a user to the UserTracker instance.
What should you do?

send
light_mode
delete
Question #24
DRAG DROP -
You develop an application that displays information from log files when errors occur. The application will prompt the user to create an error report that sends details about the error and the session to the administrator.
When a user opens a log file by using the application, the application throws an exception and closes.
The application must preserve the original stack trace information when an exception occurs during this process.
You need to implement the method that reads the log files.
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.)
Select and Place:

You develop an application that displays information from log files when errors occur. The application will prompt the user to create an error report that sends details about the error and the session to the administrator.
When a user opens a log file by using the application, the application throws an exception and closes.
The application must preserve the original stack trace information when an exception occurs during this process.
You need to implement the method that reads the log files.
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.)
Select and Place:

Correct Answer:
✑ StringReader - Implements a TextReader that reads from a string.
✑ StreamReader - Implements a TextReader that reads characters from a byte stream in a particular encoding.
Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.
References:
http://msdn.microsoft.com/en-us/library/system.io.stringreader(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/system.io.streamreader(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/ms182363(v=vs.110).aspx

✑ StringReader - Implements a TextReader that reads from a string.
✑ StreamReader - Implements a TextReader that reads characters from a byte stream in a particular encoding.
Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.
References:
http://msdn.microsoft.com/en-us/library/system.io.stringreader(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/system.io.streamreader(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/ms182363(v=vs.110).aspx
send
light_mode
delete
Question #25
DRAG DROP -
You are developing an application that includes a class named Kiosk. The Kiosk class includes a static property named Catalog. The Kiosk class is defined by the following code segment. (Line numbers are included for reference only.)

You have the following requirements:
✑ Initialize the _catalog field to a Catalog instance.
✑ Initialize the _catalog field only once.
✑ Ensure that the application code acquires a lock only when the _catalog object must be instantiated.
You need to meet the requirements.
Which three code segments should you insert in sequence at line 09? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:
You are developing an application that includes a class named Kiosk. The Kiosk class includes a static property named Catalog. The Kiosk class is defined by the following code segment. (Line numbers are included for reference only.)

You have the following requirements:
✑ Initialize the _catalog field to a Catalog instance.
✑ Initialize the _catalog field only once.
✑ Ensure that the application code acquires a lock only when the _catalog object must be instantiated.
You need to meet the requirements.
Which three code segments should you insert in sequence at line 09? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:
Correct Answer:
After taking a lock you must check once again the _catalog field to be sure that other threads didn't instantiated it in the meantime.

After taking a lock you must check once again the _catalog field to be sure that other threads didn't instantiated it in the meantime.
send
light_mode
delete
All Pages