[go: up one dir, main page]

0% found this document useful (0 votes)
105 views6 pages

Easy Crambible Lab: Application Development Foundation

Microsoft.NET Framework, Application Development Foundation Single-user License This copy can only be used by yourself for educational purposes. Try to understand the concepts behind the questions instead of cramming the questions.

Uploaded by

rask_77
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views6 pages

Easy Crambible Lab: Application Development Foundation

Microsoft.NET Framework, Application Development Foundation Single-user License This copy can only be used by yourself for educational purposes. Try to understand the concepts behind the questions instead of cramming the questions.

Uploaded by

rask_77
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

70536

Easy CramBible Lab

70-536

Microsoft .NET Framework, Application Development Foundation


** Single-user License ** This copy can be only used by yourself for educational purposes Web: http://www.crambible.com/ E-mail: web@crambible.com

(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

70536

Important Note PleaseReadCarefully Study Tips Thisproductwillprovideyouquestionsandanswersalongwithcarefullycompiledandwrittenbyourexperts. Trytounderstandtheconceptsbehindthequestionsinsteadofcrammingthequestions. Gothroughtheentiredocumentatleasttwicesothatyoumakesurethatyouarenotmissinganything. Latest Version Weareconstantlyreviewingourproducts.Newmaterialisaddedandoldmaterialisrevised.Freeupdatesare availablefor90daysafterthepurchase.YoushouldcheckyourmemberzoneatCramBibleanupdate34days beforethescheduledexamdate. Hereistheproceduretogetthelatestversion: 1.Gotowww.CramBible.com 2.ClickonMemberzone/Login 3.Thelatestversionsofallpurchasedproductsaredownloadfromhere.Justclickthelinks. Formostupdates,itisenoughjusttoprintthenewquestionsattheendofthenewversion,notthewhole document. Feedback Feedbackonspecificquestionsshouldbesendtoweb@CramBible.com.Youshouldstate:Examnumberand version,questionnumber,andloginID. Ourexpertswillansweryourmailpromptly. Copyright Eachpdffilecontainsauniqueserialnumberassociatedwithyourparticularnameandcontactinformation forsecuritypurposes.Soifwefindoutthataparticularpdffileisbeingdistributedbyyou,CramBiblereserves therighttotakelegalactionagainstyouaccordingtotheInternationalCopyrightLaws.

(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

70536

THE TOTAL NUMBER OF QUESTIONS IS 352

QUESTION NO: 1 You work as the application developer at Crambible.com. Crambible.com uses Visual Studio.NET 2005 as its application development platform. You are in the process of storing numerical values up to 2,100,000,000 into a variable and may require storing negative values using a .NET Framework 2.0 application. You are required to optimize memory usage What should you do? A. Int32 B. UInt16 C. UInt32 D. Int16 Answer: A Explanation: The Int32 type should be used in the scenario as it can be used to store positive and negative numerical values from -2,147,483,648 to +2,147,483,647. Incorrect Answers: B: The UINT32 and UInt16 type should not be used in the scenario because they are used to store only unsigned positive numbers. C: The UINT32 and UInt16 type should not be used in the scenario because they are used to store only unsigned positive numbers. D: The Int16 type should not be used as you will only be allowed to store values from -32768 to +32768.

QUESTION NO: 2 You work as an application developer at Crambible.com. You are currently in the process of creating a class that stores data about Crambible.com's customers. Crambible.com customers are assigned unique identifiers and various characteristics that may include aliases, shipping instructions, and sales comments. These characteristics can change in both size and data type. You start by defining the Customer class as shown below: public class Customer { private int custID; private ArrayList attributes; public int CustomerID { get {return custID;} } public Customer (int CustomerID) { this.custID = CustomerID; this.attributes = new ArrayList (); } public void AddAttribute (object att) {
(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

70536

attributes.Add (att); } } You have to create the FindAttribute method for locating attributes in Customer objects no matter what the data type is. You need to ensure that the FindAttribute method returns the attribute if found, and you also need to ensure type-safety when returning the attribute. What should you do? A. Use the following code to declare the FindAttribute method: public T FindAttribute (T att) { //Find attribute and return the value } B. Use the following code to declare the FindAttribute method: public object FindAttribute (object att) { //Find attribute and return the value } C. Use the following code to declare the FindAttribute method: public T FindAttribute <T> (T att) { //Find attribute and return the value } D. Use the following code to declare the FindAttribute method: public string FindAttribute (string att) { //Find attribute and return the value }

Answer: C Explanation: This code declares the method FindAttribute and specifies an argument named att using the T placeholder as the argument and return data type. To ensure the FindAttribute method accepts arguments of different types, you should specify an argument using a generic placeholder. The argument att in this generic method will accept any valid data type and ensures type-safety by returning that same data type. Incorrect Answers: A: You should not use this code because it does not declare the placeholder T. when declaring a generic method, you have to use the < > bracketsto declare the place holder before using it. B: You should not use this code because it does not guarantee type-safery. D: You should not use this code because it will only accept a string argument and return a string argument.

QUESTION NO: 3
(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

70536

You work as an application developer at Crambible.com. You are creating a custom exception class named ProductDoesNotExistException so that custom exception messages are displayed in a new application when the product specified by users is unavailable. This custom exception class will take the ProductID as an argument to its constructor and expose this value through the ProductID. You are now in the process of creating a method named UpdateProduct. This method will be used to generate and manage the ProductDoesNotExistException exception if the ProductID variable contains the value 0. You need to ensure that use the appropriate code for the UpdateProduct method. What should you do? A. Make use of the following code: public void UpdateProduct () { try { if (ProductID == 0) throw new ProductDoesNotExistException (ProductID); } catch (ProductDoesNotExistException ex) { MessageBox.Show ("There is no Product" + ex. ProductID); } } B. Make use of the following code: public void UpdateProduct () { try { if (ProductID = = 0) throw new Exception ("Invalid ProductID"); } catch (ProductDoesNotExistException ex) { MessageBox.Show (ex.Message); } } C. Make use of the following code: public void UpdateProduct () { if (ProductID = = 0) throw new ProductDoesNotExistException (ProductID); } D. Make use of the following code: public void UpdateProduct () { if (ProductID = = 0) throw new Exception ("Invalid ProductID"); }

Answer: A Explanation: This code verifies the value of the ProductID variable by using the if statement. If the ProductID variable contains a value of 0, this code generates an exception of type ProductDoesNotExistException. To explicitly generate an exception, you are required to use the throw statement. The exception generated by using the throw statement can be handled by the try...catch block. This code generates the custom exception by calling the constructor of the custom exception class named ProductDoesNotExistException. The constructor argument is
(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

70536

the ProductID attached to the ProductDoesNotExistException object. This code then handles the custom exception named ProductDoesNotExistException by using a catch block, which handles exceptions by using a variable named ex of the type ProductDoesNotExistException. This code displays the "There is no Product" error message by using the MessageBox.Show method and concatenating the ex.ProductID to it. Incorrect Answers: B: You should not use the code that generates an exception of the type Exception and handles the exception of the type ProductDoesNotExistException in the catch block. This code is incorrect because you are required to generate a custom exception named ProductDoesNotExistException. C: You should not use the codes that do not use a try...catch block because the application an unhandled exception. D: You should not use the codes that do not use a try...catch block because the application an unhandled exception.

QUESTION NO: 4 You work as the application developer at Crambible.com. Crambible.com uses Visual Studio.NET 2005 as its application development platform. You have recently finished development of a class named TestReward and package the class in a .NET 2.0 assembly named TestObj.dll. After you ship the assembly and it is used by client applications, you decide to move the TestReward class from TestObj.dll assembly to the TestRewardObj.dll Assembly. You are to ensure when you ship the updated TestObj.dll and TestRewardObj.dll assemblies that the client applications continue to work and do not require recompiling. What should you do? A. The TypeForwardedTo attribute should be used B. The TypeConvertor.ConvertTo method should be used C. The InternalsVisibleTo attribute should be used D. The Type Convertor.ConvertFrom method should be used Answer: A Explanation: The statement used for you to add a type from one assembly into another assembly is the TypeForwardTo attribute which enables you not to have the application recompiled. Incorrect Answers: B: The TypeConverter class provides a unified way of converting different types of values to other types and can not be used to move a type. C: The method in question here specifies all nonpublic types in an assembly are visible to other assemblies but can not be used to move types. D: The TypeConverter class provides a unified way of converting different types of values to other types and can not be used to move a type.
(C) Copyright 1998 Easy CramBible Lab, All Rights Reserved.

You might also like