Microsoft 70-483 Exam Practice Questions (P. 2)
- 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 #6
DRAG DROP -
You are developing an application by using C#. The application includes an array of decimal values named loanAmounts. You are developing a LINQ query to return the values from the array.
The query must return decimal values that are evenly divisible by two. The values must be sorted from the lowest value to the highest value.
You need to ensure that the query correctly returns the decimal values.
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 are developing an application by using C#. The application includes an array of decimal values named loanAmounts. You are developing a LINQ query to return the values from the array.
The query must return decimal values that are evenly divisible by two. The values must be sorted from the lowest value to the highest value.
You need to ensure that the query correctly returns the decimal values.
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:
Note: In a query expression, the orderby clause causes the returned sequence or subsequence (group) to be sorted in either ascending or descending order.
Examples:
// Query for ascending sort.
IEnumerable<string> sortAscendingQuery =
from fruit in fruits
orderby fruit //"ascending" is default
select fruit;
// Query for descending sort.
IEnumerable<string> sortDescendingQuery =
from w in fruits
orderby w descending
select w;

Note: In a query expression, the orderby clause causes the returned sequence or subsequence (group) to be sorted in either ascending or descending order.
Examples:
// Query for ascending sort.
IEnumerable<string> sortAscendingQuery =
from fruit in fruits
orderby fruit //"ascending" is default
select fruit;
// Query for descending sort.
IEnumerable<string> sortDescendingQuery =
from w in fruits
orderby w descending
select w;
send
light_mode
delete
Question #7
You are developing an application. The application includes a method named ReadFile that reads data from a file.
The ReadFile() method must meet the following requirements:
✑ It must not make changes to the data file.
✑ It must allow other processes to access the data file.
✑ It must not throw an exception if the application attempts to open a data file that does not exist.
You need to implement the ReadFile() method.
Which code segment should you use?
The ReadFile() method must meet the following requirements:
✑ It must not make changes to the data file.
✑ It must allow other processes to access the data file.
✑ It must not throw an exception if the application attempts to open a data file that does not exist.
You need to implement the ReadFile() method.
Which code segment should you use?
- Avar fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.ReadWrite);
- Bvar fs = File.Open(Filename, FileMode.Open, FileAccess.Read,FileShare.ReadWrite);
- Cvar fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read,FileShare.Write);
- Dvar fs = File.ReadAllLines(Filename);
- Evar fs = File.ReadAllBytes(Filename);
Correct Answer:
A
FileMode.OpenOrCreate - Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. If the file is opened with
FileAccess.Read, FileIOPermissionAccess.Read permission is required. If the file access is FileAccess.Write, FileIOPermissionAccess.Write permission is required. If the file is opened with FileAccess.ReadWrite, both FileIOPermissionAccess.Read and FileIOPermissionAccess.Write permissions are required.
FileShare.ReadWrite - Allows subsequent opening of the file for reading or writing. If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file.
References:
http://msdn.microsoft.com/pl-pl/library/system.io.fileshare.aspx http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx
A
FileMode.OpenOrCreate - Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. If the file is opened with
FileAccess.Read, FileIOPermissionAccess.Read permission is required. If the file access is FileAccess.Write, FileIOPermissionAccess.Write permission is required. If the file is opened with FileAccess.ReadWrite, both FileIOPermissionAccess.Read and FileIOPermissionAccess.Write permissions are required.
FileShare.ReadWrite - Allows subsequent opening of the file for reading or writing. If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file.
References:
http://msdn.microsoft.com/pl-pl/library/system.io.fileshare.aspx http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx
send
light_mode
delete
Question #8
An application receives JSON data in the following format:

The application includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object.
Which code segment should you insert at line 10?

The application includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object.
Which code segment should you insert at line 10?
- AReturn ser.ConvertToType<Name>(json);
- BReturn ser.DeserializeObject(json);
- CReturn ser.Deserialize<Name>(json);
- DReturn (Name)ser.Serialize(json);
Correct Answer:
C
JavaScriptSerializer.Deserialize<T> - Converts the specified JSON string to an object of type T.
References: http://msdn.microsoft.com/en-us/library/bb355316.aspx
C
JavaScriptSerializer.Deserialize<T> - Converts the specified JSON string to an object of type T.
References: http://msdn.microsoft.com/en-us/library/bb355316.aspx
send
light_mode
delete
Question #9
You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object.
The application includes the following code. (Line numbers are included for reference only.)

You need to serialize the Location object as a JSON object.
Which code segment should you insert at line 20?
The application includes the following code. (Line numbers are included for reference only.)

You need to serialize the Location object as a JSON object.
Which code segment should you insert at line 20?
- ANew DataContractSerializer(typeof(Location))
- BNew XmlSerializer(typeof(Location))
- CNew NetDataContractSenalizer()
- DNew DataContractJsonSerializer(typeof(Location))
Correct Answer:
D
The DataContractJsonSerializer class serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects.
Use the DataContractJsonSerializer class to serialize instances of a type into a JSON document and to deserialize a JSON document into an instance of a type.
D
The DataContractJsonSerializer class serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects.
Use the DataContractJsonSerializer class to serialize instances of a type into a JSON document and to deserialize a JSON document into an instance of a type.
send
light_mode
delete
Question #10
You are developing an application by using C#. The application includes the following code segment. (Line numbers are included for reference only.)

The DoWork() method must not throw any exceptions when converting the obj object to the IDataContainer interface or when accessing the Data property.
You need to meet the requirements. Which code segment should you insert at line 07?

The DoWork() method must not throw any exceptions when converting the obj object to the IDataContainer interface or when accessing the Data property.
You need to meet the requirements. Which code segment should you insert at line 07?
- Avar dataContainer = (IDataContainer)obj;
- Bdynamic dataContainer = obj;
- Cvar dataContainer = obj is IDataContainer;
- Dvar dataContainer = obj as IDataContainer;
Correct Answer:
D
As - The as operator is like a cast operation. However, if the conversion isn't possible, as returns null instead of raising an exception.
References: http://msdn.microsoft.com/en-us/library/cscsdfbt(v=vs.110).aspx
D
As - The as operator is like a cast operation. However, if the conversion isn't possible, as returns null instead of raising an exception.
References: http://msdn.microsoft.com/en-us/library/cscsdfbt(v=vs.110).aspx
send
light_mode
delete
All Pages