Practice Questions

Question 1

The framework class library (FCL) includes which of the following?

  • A. Custom classes created by a particular developer

  • B. Custom classes shared by a particular project

  • C. Public classes common to the .NET Framework

  • D. Private classes common to the .NET Framework

A1:

Answer C is correct. The FCL includes hundreds of public classes that may be used in an application developed within the .NET Framework. Answers A and B are incorrect because the FCL contains classes common to the .NET Framework rather than custom user -created classes. Answer D is incorrect because the classes within the FCL are public rather than private.

Question 2

Which of the following can you access through code? [Select all correct answers.]

  • A. Static properties of a class

  • B. Nonstatic properties of a class

  • C. Properties of an instance

  • D. Methods of an instance

A2:

Answers A, C, and D are correct. Answer B is incorrect because a class is an abstract concept grouping properties and methods that may be used by an instance of the class. If the class is not instantiated , it cannot be directly accessed. Only static members (answer A) can be used without instantiating the class. If you instantiate the class, you have full access to its methods and properties. Therefore, answers C and D are correct.

Question 3

Your project contains a Ball class and a Basketball class. The Basketball class inherits from the Ball class. Which access modifiers can you use on a property in the Ball class to make that property available to the Basketball class? [Select all correct answers.]

  • A. Public

  • B. Private

  • C. Protected

  • D. Friend

A3:

Answers A, B, C, and D are all correct. Any class may access the public properties of a class. An inherited class inherits private and protected properties and therefore may access them directly. Any classes within the same project may inherit friend properties.

Question 4

Which keyword declares a constructor in Visual Basic .NET?

  • A. The Get keyword

  • B. The Set keyword

  • C. The New keyword

  • D. The Show keyword

A4:

Answer C is correct. The New keyword is used to indicate the constructor of a class, which is called to create a new instance of the class. The Get and Set keywords are used in property procedures, to read and write the values of properties. The Show method is used to display a form on screen. Therefore, answers a, b, and d are all incorrect.

Question 5

Which method of the Form class must you call in order to remove a form and be able to reopen it later with the same information present?

  • A. Exit

  • B. Hide

  • C. Close

  • D. Fill

  • E. Show

A5:

Answer B is correct. The Hide method allows a form to be temporarily hidden and later accessed with the information intact. Answer A is incorrect because objects of the Application class (not forms) inherit the Exit method. Answer C is incorrect because the Close method closes a form completely, and the form loses its current settings if it is later reopened. Answer D is incorrect because the Fill method is used to draw a filled graphics object rather than to hide a form. Answer E is incorrect because the Show method is used to reveal a form rather than to conceal it.

Question 6

You are creating a class named MyNamespace.SpecificNamespace.Class2 . Which of the following classes could your new class inherit from? [Select all correct answers.]

  • A. Microsoft.Windows.Forms.Control

  • B. MyNamespace.Class1

  • C. MyNamespace.SpecificNamespace.Class1

  • D. MyNamespace.SpecificNamespace.Class2

A6:

Answers A, B, and C are correct. Although the namespace hierarchy is used in order to organize the various classes within a project, this hierarchy is independent from the chain of inheritance. A class may inherit from any other class throughout the namespace hierarchy. However, answer D is incorrect because a class cannot inherit from itself.

Question 7

Which of the following statements is true if Form1 has been configured with an Opacity value of .3 and Form2 has been configured with an Opacity value of 1?

  • A. Form1 will be displayed on top of Form2.

  • B. Form2 will be displayed on top of Form1.

  • C. Form1 is 30% transparent.

  • D. Form1 is 70% transparent.

  • E. Form2 is transparent.

A7:

Answer D is correct. The Opacity value is set on a form in order to determine how much of a covered form it will occlude. A setting of .3 opacity means that 30% of the background will be occluded, so the form is 70% transparent. Answers A and B are incorrect because the Opacity property does not dictate which form will be topmost. Answer C is incorrect because 30% transparency would require an Opacity value of .7, and answer D is incorrect because neither form is transparent. Form2 is completely opaque with an Opacity value of 1.

Question 8

You have configured a form to include several Graphics objects, but the circles, ellipses, and squares are not drawn when the form is loaded. The text is drawn on the form, though, which tells you that the System.Drawing.dll is available. Which of the System.Drawing namespaces needs to be explicitly imported to fix the problem?

  • A. System.Drawing

  • B. System.Drawing.Drawing2D

  • C. System.Drawing.Imaging

  • D. System.Drawing.Text

A8:

Answer B is correct. In order to include the ability to draw and fill many of the standard shapes , you must include the code to import the System.Drawing.Drawing2D namespace. Answers A and D are incorrect because the DrawString function is already available to draw text on the form. Answer C is incorrect because the Drawing2D namespace contains the members necessary in order to draw two-dimensional (flat) shapes.

Question 9

You need to measure the size of a form. You know that the corner opposite the origin (0,0) is at location (128,164). The form has a 3-pixel-wide border and a 20-pixel-high title bar. What is the width and height of the form?

  • A. Width: 122, Height: 138

  • B. Width: 138, Height: 122

  • C. Width: 128, Height: 144

  • D. Width: 128, Height: 164

A9:

Answer D is correct. The Size property specifies the overall size of the form, measured from its origin. Answer A is incorrect because it specifies only the user area of the form, excluding the borders and title bar. Answer B is incorrect because it is the measurement of the user area, reversed in width and height. Answer C is incorrect because it specifies the proper measurements for the user area if the borders were zero pixels wide.

Question 10

You are using the classes in the System.Drawing namespace to render your company's logo to a Windows form. You wish to ensure that the small text in the logo is as clear as possible. Which member of the SmoothingMode enumeration should you use in your code?

  • A. AntiAlias

  • B. Default

  • C. HighSpeed

  • D. None

A10:

Answer A is correct. If you use SmoothingMode.AntiAlias (or SmoothingMode.HighQuality ), text will be antialiased. When antialiasing is used, two bordering colors are overlaid by semitransparent pixels of the opposing type, generating a smooth-appearing transition rather than a sharp, pixelated border. Answers B is incorrect because antialiasing is off by default. Answer C is incorrect because high-speed drawing is done without antialiasing. Answer D is incorrect because antialiasing will not be performed unless you specifically request it.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net