GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

70-483: Exam Questions

Paige Gentry 67 Fragen

Quiz starten

Dieses Quiz enthält Fragetypen, die sich im gewohnten Player öffnen.

Fragen in diesem Quiz (67)

  1. 1You are developing an application. The application calls a method that returns an array of integers named employeeIds. You define an integer varaiable named employeeIdToRemove and assigna a value to it. You declare an array named filteredEmployeeIds.
    You have the following requirements:
    - Remove duplicate integers from the employeeIds array
    - Sort the array in order from the highest to the lowest value
    - Remove the integer value stored in the employeeIdToRemove variable from the employeeIds array

    You need to create a LINQ query to meet the requirements. Which should you do?
    1. AA. int[] filteredEmployeeIds = employeeIds.Where(v => v != employeeIdToRemove).OrderBy(x => x).ToArray();
    2. BB. int[] filteredEmployeeIds = employeeIds.Where(v => v != employeeIdToRemove).OrderByDescending(x => x).ToArray();
    3. CC. int[] filteredEmployeeIds = employeeIds.Distinct().Where(v => v != employeeIdToRemove).OrderByDescending(x => x).ToArray();
    4. DD. int[] filteredEmployeeIds = employeeIds.Distinct().OrderByDescending(x => x).ToArray();
  2. 2You are developing an application that includes a class named Order. The application will store a 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
    - User zero-based indices
    Which Collection would you use?
    1. AQueue<T>
    2. BSortedList
    3. CLinkedList<T>
    4. DHashTable
    5. EArray<T>
  3. 3You are developing an application that includes the following code segment.
    01 Class Animal {
    02 public string Color { get; set;}
    03 public string Name { get; set; }
    04 }
    05
    06 private static IEnumerable<Animal> GetAnimals(string sqlConnectionString) {
    07 var animals = new List<Animal>();
    08 SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);
    09
    10 using (sqlConnection) {
    11 SqlCommand sqlCommand = new SqlCommand("Select Name, ColorName FROM Animcals", sqlConnection);
    12 <MISSING LINE>
    13
    14 using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader()) {
    15 <MISSING LINE> {
    16 var animal = new Animal();
    17 animal.Name = (string)sqlDataReader("Name");
    18 animal.Color = (string)sqlDataReader("ColorName");
    19 animals.Add(animal);
    20 }
    21 }
    22 }
    23 return customers;
    24 }

    The GetAnimals() method must meed the following requirements:
    - Connect to a Microsoft SQL Server database
    - Create Animal objects and populate them with data from the database
    - Return a sequence of populated Animal objects

    Which two action should you perform to meet the requirements?
    1. AA. At Line 15 insert: while ( sqlDataReader.NextResult() )
    2. BB. At Line 12 insert: sqlConnection.BeginTransaction();
    3. CC. At Line 12 insert: sqlConnection.Open()
    4. DD. At Line 15 insert: while ( sqlDataReader.Read() )
    5. EE. At Line 15 insert: while ( sqlDataReader.GetValues() )
  4. 4You are developing a custom collection named LoanCollection for a class named Loan class. You need to ensure that you can process each Loan object in the LoanCollection by using a foreach loop. How should you complete the relevant code?

    public class Loan Collection [blank_start]: IEnumerable[blank_end] {
    ....private readonly Loan[] _loanCollection;

    ....public LoanCollection( Loan[] loanArray) {
    ........_loanCollection = new Loan[loanArray.Length];

    ........for(int i = 0; i < loanArray.Length; i++) {
    ............_loanCollection[i] = loanArray[i];
    ........}
    ....}
    ....[blank_start]public IEnumerator GetEnumerator() {[blank_end]
    ........[blank_start]return _loanCollection.GetEnumerator();[blank_end]
    ....}
    }
    1. A: IEnumerable
    2. B: IComparable
    3. C: IDisposable
    4. Dpublic IEnumerator GetEnumerator() {
    5. Epublic int CompareTo (object obj)
    6. Fpublic void Dispose()
    7. Greturn _loanCollection.GetEnumerator();
    8. H_loanCollection[0].Amount++;
    9. Ireturn obj==null? :_loanCollection.Lengt
  5. 5You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database.

    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 in the OrderDate property or in a later year
    01 public DateTime? OrderDate;
    02
    03 IQueryable<Order> LookupOrdersForYear (int year) {
    04 using ( var context = new NorthwindEntities() ) {
    05 var orders = from order in context.Orders
    06 <MISSING LINE>
    07 select order;
    08
    09 return orders.ToList().AsQueryable();
    10 }
    11 }

    What code segment should you insert at line 06 to ensure the requirements are met?
    1. AA. Where order.OrderDate.Value != null && order.OrderDate.Value.Year >= year
    2. BB. Where order.OrderDate.Value == null && order.OrderDate.Value.Year == year
    3. CC. Where order.OrderDate.HasValue && order.OrderDate.Value.Year == year
    4. DD. Where order.OrderDate.Value.Year == year
  6. 6You 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.

    How should you complete the code to ensure the query correctly returns the decimal values?

    decimal[] loanAmounts = { 303m, 10000m, 12353m, 503.13m, 409m, 32m, 500m };
    IEnumerable<decimal> loanQuery =
    [blank_start]from[blank_end] amount in loanAmounts
    [blank_start]where[blank_end] amount % 2 == 0
    [blank_start]orderby[blank_end] amount [blank_start]ascending[blank_end]
    [blank_start]select[blank_end] amount;
    1. Afrom
    2. Bjoin
    3. Cwhere
    4. Dgroup
    5. Eorderby
    6. Fdescending
    7. Gselect
    8. Hascending
  7. 7You 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.

    Which code segment should you use to implement to ReadFile() method?
    1. AA. var fs = File.ReadAllBytes(Filename);
    2. BB. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
    3. CC. var fs = File.ReadAllLines(Filename);
    4. DD. var fs = File.Open(Filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
    5. EE. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.Write);
  8. 8An application receives JSON in the following format:
    { "FirstName" : "David",
    "LastName" : "Jones",
    "Values" : [0, 1, 2] }

    The application includes the following code segment:

    01 public class Name {
    02 public int[] Values { get; set; }
    03 public string FirstName { get; set; }
    04 public string LastName { get; set; }
    05 }
    06
    07 public static Name ConvertToName(string json) {
    08 var ser = new JavaScriptSerializer();
    09 <MISSING LINE>
    10 }

    Which code segment should be inserted at line 09 to ensure that ConvertToName() method returns the JSON input string as a Name object?
    1. AA. Return ser.ConvertToType<Name> ( json );
    2. BB. Return ser.DeserializeObject( json );
    3. CC. Return ser.Deserialize<Name> ( json );
    4. DD. Return (Name)ser.Serialize( json );
  9. 9An application serializes and deserializes XML from streams. The XML streams are in the following format:

    <Name xmlns = "http://www.contoso.com/2012/06">
    <LastName> Jones </LastName>
    <FirstName> David </FirstName>
    </Name>

    The application reads the XML streams by using a DataContractSerializer object that is declared by the following code segment:

    var ser = new DataContractSerializer(typeof(Name));

    How should you complete the code to ensure the application preserves the emement ordering as provided in the XML stream?

    [blank_start][DataContract ( Namespace = "xmlns")][blank_end]
    class Name {
    ......[blank_start][DataMember ( Order = 10 )][blank_end]
    ......public string FirstName { get; set; }

    ......[blank_start][DataMember][blank_end]
    ......public string LastName { get; set; }
    }
    1. A[DataContract ( Namespace = "xmlns")]
    2. B[DataContract ( Name="xmlns", Order=10)]
    3. C[DataContract ( Name = "xmlns")]
    4. D[DataContract]
    5. E[DataMember ( Name = "xmlns")]
    6. F[DataMember ( Order = 10 )]
    7. G[DataMember]
  10. 10You 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.

    01 public enum Compass {
    02 North,
    03 South,
    04 East,
    05 West
    06 }
    07
    08 [DataContract]
    09 public class Location {
    10 [DataMember]
    11 public string Label { get; set; }
    12
    13 [DataMember]
    14 public Compass Direction { get; set; }
    15 }
    16
    17 void DoWork() {
    18 var location - new Location { Label = "test", Direction = Compass.West };
    19 Console.WriteLine(
    20 WriteObject ( Location, <MISSING> ));

    Which code segment should you insert to serialize the Location object as a JSON object?
    1. AA. New DataContractSerializer( typeof ( Location ) )
    2. BB. New XmlSerializer ( typeof ( Location ) )
    3. CC. New NetDataContractSerializer()
    4. DD. New DataContractJsonSerializer ( typeof (Location ) )

Informationen

Beschreibung
Certificate 70-483: Programming in C# (Exam Questions) Quiz am 70-483: Exam Questions, erstellt von Paige Gentry am 15/06/2016.
Sprache
English
Aufrufe
281
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck