98-361 : Software Development Fundamentals : Part 08

  1. You are designing a class for an application. You need to restrict the availability of the member variable accessCount to the base class and to any classes that are derived from the base class.

    Which access modifier should you use?

    • Protected
    • Private
    • Public
    • Friend
  2. You create an object of type ANumber. The class is defined as follows.

    98-361 Part 08 Q02 052
    98-361 Part 08 Q02 052

    The code is executed as follows.

    Dim mynumber As ANumber = new ANumber(3);

    What is the value of _number after the code is executed?

    • Null
    • 0
    • 3
    • 7
  3. You are creating an application that presents users with a graphical interface in which they computers that do not have network connectivity.

    Which type of application should you choose?

    • ClickOnce
    • Windows Service
    • Windows Forms
    • Console-based
    Explanation:

    Use Windows Forms when a GUI is needed.

  4. You have a class named Truck that inherits from a base class named Vehicle. The Vehicle class includes a protected method named brake ().

    How should you call the Truck Class implementation of the brake () method?

    • Mybase.brake ()
    • Truck.brakef)
    • Vehicle.brake()
    • Me.brake ()
    Explanation:

    The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class.MyBase is commonly used to access base class members that are overridden or shadowed in a derived class.

  5. Which type of function can a derived class override?

    • A Protected Overridable member function
    • A Shared function
    • A Private Overridable function
    • A non-overridable public member function
    Explanation:

    The Overridable modifier allows a property or method in a class to be overridden in a derived class.
    You cannot specify Overridable or NotOverridable for a Private method.

  6. Class C and Class D inherit from Class B. Class B inherits from Class A. The classes have the methods shown in the following table.

    98-361 Part 08 Q06 053
    98-361 Part 08 Q06 053

    All methods have a protected scope.

    Which methods does Class C have access to?

    • only m1, m3
    • only m2, m3
    • m1, m3, m4
    • m1, m2, m3
    • m2, m3, m4
    • only m3, m4
  7. You execute the following code.

    98-361 Part 08 Q07 054
    98-361 Part 08 Q07 054

    How many times will the word Hello be printed?

    • 49
    • 50
    • 51
    • 100
    Explanation:

    The mod operator computes the remainder after dividing its first operand by its second. All numeric types have predefined remainder operators.
    In this case the reminder will be nonzero 50 times (for i with values 1, 3, 5,..,99).

  8. You are creating the necessary variables for an application. The data you will store in these variables has the following characteristics:
    – Consists of numbers
    – Includes numbers that have decimal points
    – Requires more than seven digits of precision

    You need to use a data type that will minimize the amount of memory that is used.

    Which data type should you use?

    • Decimal
    • Single
    • Byte
    • Double
    Explanation:

    The double keyword signifies a simple type that stores 64-bit floating-point values.
    Precision: 15-16 digits

  9. You are building a web application that enables international exchange students to schedule phone calls with their prospective schools.

    The application allows students to indicate a preferred date and time for phone calls. Students may indicate no preferred time by leaving the date and time field empty. The application must support multiple time zones.

    Which data type should you use to record the student’s preferred date and time?

    • uLong?
    • DateTimeOffset?
    • SByte
    • Date
    Explanation:

    datetimeoffset: Defines a date that is combined with a time of a day that has time zone awareness and is based on a 24-hour clock.

    Incorrect:
    Date: Defines a date.
    sByte: The sbyte keyword indicates an integral type that stores values in the range of -128 to 127.

  10. You execute the following code.

    98-361 Part 08 Q10 055
    98-361 Part 08 Q10 055

    What will the variable iResult be?

    • 1
    • 2
    • 3
    • 4
  11. HOTSPOT

    You are reviewing the following code that saves uploaded images.

    98-361 Part 08 Q11 056
    98-361 Part 08 Q11 056

    For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

    98-361 Part 08 Q11 057 Question
    98-361 Part 08 Q11 057 Question
    98-361 Part 08 Q11 057 Answer
    98-361 Part 08 Q11 057 Answer
  12. The following functions are defined:

    98-361 Part 08 Q12 058
    98-361 Part 08 Q12 058

    What does the console display after the following line?

    Printer(2)

    • 210
    • 211
    • 2101
    • 2121
  13. DRAG DROP

    You are developing an application to display track and field race results.

    The application must display the race results twice. The first time it must display only the winner and runner-up. The second time it must display all participants. The code used to display results is shown below.

    98-361 Part 08 Q13 059
    98-361 Part 08 Q13 059

    You need to implement the Rankings() function.

    Complete the function to meet the requirements. (To answer, drag the appropriate code segment from the column on the left to its location on the right. Each code segment may be used once, more than once, or not at all. Each correct match is worth one point.)

    98-361 Part 08 Q13 060 Question
    98-361 Part 08 Q13 060 Question
    98-361 Part 08 Q13 060 Answer
    98-361 Part 08 Q13 060 Answer
  14. How does a console-based application differ from a Windows Store app?

    • Windows Store apps do not provide a method for user input
    • Console-based applications do not display a graphical interface.
    • Windows Store apps can access network resources.
    • Console-based applications require the XNA Framework to run.
  15. You are developing an application that tracks tennis matches. A match is represented by the following class:

    98-361 Part 08 Q15 061
    98-361 Part 08 Q15 061

    A match is created by using the following code:

    98-361 Part 08 Q15 062
    98-361 Part 08 Q15 062

    How many times is the Location property on the newly created Match class assigned?

    • 0
    • 1
    • 2
    • 3
  16. DRAG DROP

    You are extending an application that stores and displays the results of various types of foot races. The application contains the following definitions:

    98-361 Part 08 Q16 062
    98-361 Part 08 Q16 062

    The following code is used to display the result for a race:

    98-361 Part 08 Q16 063
    98-361 Part 08 Q16 063

    The contents of the console must be as follows:
    – 99 seconds
    – 1.65 minutes
    – 99

    You need to implement the FootRace class.

    Match the method declaration to the method body. (To answer, drag the appropriate declaration from the column on the left to its body on the right. Each declaration may be used once, more than once, or not at all. Each correct match is worth one point.)

    98-361 Part 08 Q16 064 Question
    98-361 Part 08 Q16 064 Question
    98-361 Part 08 Q16 064 Answer
    98-361 Part 08 Q16 064 Answer
  17. You have a class named Glass that inherits from a base class named Window. The Window class includes a protected method named break().

    How should you call the Glass class implementation of the break() method?

    • Glass.break()
    • Window.break()
    • Me.break()
    • MyBase.break()
  18. You run the following code:

    98-361 Part 08 Q18 065
    98-361 Part 08 Q18 065

    What is the value of result when the code has completed?

    • 0
    • 10
    • 20
    • 30
    Explanation:

    The conditional-OR operator (||) performs a logical-OR of its bool operands. If the first operand evaluates to true, the second operand isn’t evaluated. If the first operand evaluates to false, the second operator determines whether the OR expression as a whole evaluates to true or false.

  19. HOTSPOT

    You are reviewing the following class that is used to manage the results of a 5K race:

    98-361 Part 08 Q19 066
    98-361 Part 08 Q19 066

    For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

    98-361 Part 08 Q19 067 Question
    98-361 Part 08 Q19 067 Question
    98-361 Part 08 Q19 067 Answer
    98-361 Part 08 Q19 067 Answer
  20. You create an object of type ANumber. The class is defined as follows.

    98-361 Part 08 Q20 068
    98-361 Part 08 Q20 068

    The code is executed as follows.

    98-361 Part 08 Q20 069
    98-361 Part 08 Q20 069

    What is the value of number after the code is executed?

    • Null
    • 0
    • 3
    • 7
  21. You have a table named ITEMS with the following fields:
    – ID (integer, primary key. auto generated)
    – Description (text)
    – Completed (Boolean)

    You need to insert the following data in the table:

    “Cheese”, False

    Which statement should you use?

    • INSERT INTO ITEMS (Description, Completed) VALUES (‘Cheese’, 1)
    • INSERT INTO ITEMS (ID, Description, Completed) VALUES (NEWID(), ‘Cheese’, 0)
    • INSERT INTO ITEMS (ID, Description, Completed) VALUES (1, ‘Cheese”, 0)
    • INSERT INTO ITEMS (Description, Completed) VALUES (‘Cheese’, 0)
    Explanation:

    The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.

    Incorrect:
    Not B, not C: ID is autogenerated and should not be specified.

  22. You run the following code.

    98-361 Part 08 Q22 070
    98-361 Part 08 Q22 070

    What will the value of the variable iResult be?

    • 1
    • 2
    • 3
    • 4
  23. This question requires that you evaluate the underlined text to determine if it is correct.

    The application type should be ClickOnce for an application that presents users with a graphical interface in which they can enter data, and must run on computers that do not have network connectivity.

    Instructions: Review the underlined text. If it makes the statement correct, select “No change is needed”. If the statement is incorrect, select the answer choice that makes the statement correct.

    • Windows Service
    • Windows Presentation Foundation
    • console-based
    • No change is needed
  24. HOTSPOT

    Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

    98-361 Part 08 Q24 071 Question
    98-361 Part 08 Q24 071 Question
    98-361 Part 08 Q24 071 Answer
    98-361 Part 08 Q24 071 Answer

    Explanation:

    A value type holds a data value within its own memory space while a reference type holds a pointer to the memory location that holds the data.

    Bool and char are value types; String is a reference type.