0% found this document useful (0 votes)
38 views8 pages

MCQ 3

XYZ

Uploaded by

fariahh999
Copyright
© © All Rights Reserved
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)
38 views8 pages

MCQ 3

XYZ

Uploaded by

fariahh999
Copyright
© © All Rights Reserved
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/ 8

Q1.

Consider you have created the following WPF code


<window>
<stackpanel>
<button x:name=’button1/>
</stackpanel>
</window>
In the above example if the event execution happens from window> stack panel> button the above
illustration is an example of which of the following event of WPF?
Ans: Tunneling

Q2. Which of the following is the correct option for an input field that allows only letters andnumbers?
Ans: A – with (p in option) A – with [a-zA-Z0-9]

Q3. Which of the following statements are true with respect to WCF?
Ans: B – Longest option

Q4. Which of the below statements regarding WCF service hosting are true?
Ans: a. WCF service can be hosted in internet information services
b. WCF service can be hosted in windows process activation services.

Q5. Which base class is inherited by all WPF and layout controls?
Ans: frameworkelement

Q6. Angie is a software developer and she had created registration page with 5 textbox controls and
she wants to ensure that all the text boxes cannot be empty and user must enter some data which
validation control would you suggest for Angie
Ans: Requiredfieldvalidator

Q7. Which attribute need to be specified for the class to indicate that the class is technically belongsfor
testing?
Ans: Testclass

Q8. Peter is creating Service using WCF he wants to know which contact is used for describing complex
types like classes created to represent information like employee kindly suggest Peter inidentifying the
suitable contract
Ans: Data contract

Q9. Consider the interface shown below and we want to ensure that the methods inside theinterface
should be made available to client in WCF
Which of the following contract should be defined for the methods
[servicecontract]
Interface calculator
{
Int add(int num1, int num2);
Int mul( int num1, int num2);
}
Ans: D – operation contract

Q10. Which of the following elements cannot be represented using input tag like : <input type = “ “/> in
type we will mention which element we want to represent
A. number
B. time
C. meter
D. color
Ans: Meter
Q12. Identify which of the following is the correct sequence of execution of events in an asp.net
webforms application
page in it→ page load→ postback events→ page prerender→ page unload
page init→ page load page→page prerender→ page unload→ postback events
page init→ page load →postback events→ page unload →page prerender
page load →page init→ postback events →page prerender→ page download
Ans: page in it→ page load→ postback events→ page prerender→ page unload

Q14. Consider the class “calculator” shown below and we want to ensure that the properties inside
the class should be made available to client in WCF.
Which of the following should be defined for the properties?
[datacontract]
Class calculator
{
Public int num1{ get ; set;}
Public int num2{get; set;}
}
Ans: Datamember

Q15. Which of the following statement is true about unit testing?


Ans: Option A- Unit testing verifies that a method or set of methods meet the requirements

Q16. To support <SVG> and <canvas> tags which comment is introduced in HTML5?
Ans: Vector graphics

Q17. Consider the following asp.net code


Protected void page_layout( objects sender, eventargs e)
{
Dropdownlist1.items.add(‘jio’);
Dropdownlist1.items.add(‘vodafone’);
}
When the below code is executed its found that the dropdown list was loaded with same datamultiple
times on click of button
which of the following options can resolve the problem
Ans: write above code inside if(lspostback==false)

Q18. Consider the following code


<window x:class=”wpfsoln”>
In the above example when yesbutton is clicked yesbutton_button click event i.e the same event
handler operation is executed
the above illustration is an example of which of the following event of WPF
Ans: Direct

Q19. Identify which of the following is a server side statemanagement technique in asp.net
Ans: Session, Applications and caching

Q20. Identify which of the following is a client side statemanagement technique in asp.netwebforms
Ans: cookies, ViewState, QueryString and HiddenFields

Q20. Tom is novice developer and Tom wants to ensure that the user must enter data into the textbox
which attributes should be used to achieve it
Ans: option B - Required
Q21. Peter is creating service using WCF he wants to know which contract is used for error handling
kindly suggest Peter in identifying suitable contract.
Ans: B - Fault Contract

Q23. Consider the following code in WCF


Interface mathdata
{
Int add(int num1, int num2);
}
What should be the contract defined for interface mathdata and method add to make themavailable
to client to consume
Ans: C – mathdata should be defined as service contract and method add as operationcontract

Q24. Consider You have a customer form containing two text boxes named as “txtpassword” and
”txtconfirmpassword” you need to ensure that value entered in confirm password () textbox must
watch the value entered in password textbox ()
Which of the following options will you use to achieve the same
Ans: option C (set controltovalidate=”txtpasswod” controltocompare=”txtconfirmpassword”)

Q25. You are creating a web form using asp.net webform uses a drop down list called
DDLdepartments, to display a list of departments the department name (deptname) is displayed as the
options in the drop down When the user selects a Name the corresponding department ID is taken as
the value how will you implement this in asp.net
Ans: option B (ddldeptartments.datatextfield=”deptname”;
ddldeptatments.datavaluefield=”deptid”);

Q26. You have created a score page using asp.net webformsthere is a textbox control named as
“txtmarks” you need to validate the txtmarks value by ensuring that the values entered are between 0
and 100 onlywhich control is most suitable to perform this task
Ans: range validator

Q27. Peter is in novice developer and he has written a web based application and he wants to test the
functionality of the web applications which of the following test would you suggest Peter to use
Ans: Web test

Q29. Mark is a novice developer and he wants to ensure that the first name length should not exceed
15 characters. suggest the suitable HDMI attribute to be used by mark to achieve the same
Ans: option C- Maxlength

Q32. Refer to incomplete code given below


<HTML>
<body>
<form>
email <input type=” “ID=”txtemail”/>
phone numberdate of birth
choose a valid option to complete the above code so that user can enter only email phone number and
date of birth in respectively fields
Ans: email, number, date
Q33. WCF achieves reliable messaging using which of the following?
Ans: MSMQ

Q34. Identify which of the following layout controls aligns the child controls in the edges of the panel?
Ans: Dockpanel

Q35. Consider the method as follows:


public int Add(int a , int b)
{
Return a+b;
}
Which of the following asset class method is used to check whether the add method works correctly
when the value is passed
Ans:option A / AreEqual()

Q36. Which of the following hosting services are provided by WCF?


A executable(EXE)
B windows service
Ans: Both A and B

Q37. How will the service endpoint inform the service clients about the particular transport protocol
and encoding technique which clients must support to access the service?
Ans: Option B - Binding

Q39. Consider you are developing an asp.net web application. whenever a user selects a value in a
drop down list called DDLemployees the application fetches a list of records from the database and
stores them in a data table called DLemployee this data table must be bound to a gridview called
gvemployee which of the following options will solve the problem.
Ans. B and C
gvemployee,datasource,dtemployee;
gvemployees, databind()

Q44. Which of the following are the reason for activating or hosting a WCF service?
Ans: To run the service

Q46. The………Is a global object used for server-side state management of asp.net webforms and
accessible by all users and pages of a web application
Ans: A – Application

Q50. Angine is a novice developer and she wants to ensure that the firstname text box should allow
only alphabets and special characters like dot. Suggested the suitable HTML5 attribute to be used by
Angie to achieve the same?
Ans: Pattern

Q51. You are creating a web form using asp.net the form requires a start date and an end date to be
entered you want to ensure that the start date is always lesser than the end date which validation
control can you help you achieve this least effort?
Ans: Compare validator
Q58. You have created a WCF service to return the latest share prices for online trading the client
application is a WPF app how will the WPF app know where the WCF services located?
Ans: Option B- Using the url contained in the endpoint address

Q62. Consider the following code:


<window x:clss=”WPFSoln”>
……………………
In the above example when the cancelbutton is clicked there are no events defined for cancel button
so considering that on click of cancel button if executed the parent event i.e stacked panels
button.click event the above illustration is an example of which of the following event of WPF

Ans: Option B- Bubbling

Q64. What is wrong with the following mark up


<asp:textbox id=”textbox1” runat=”server”/>
<asp:requiredfieldvalidator id=”valrequired”
Runat=”server” Errormessage “ you must enter a value into textbox”Display=”dynamic”/>
</asp:requiredfieldvalidator>

Ans: Option C – ControlToValidate property

Q65. Which of the following statement is true about WCF proxy?


Ans: Option D- proxy gets generated when you execute the client application

Q67. Which of the following feature of WCF helps in customizing the behavior of service?

Ans: Option A- Attribute based programming

Q69. You have created a registration page using asp.net webforms you have used various validation
controls for the fields accepted as user input from the page in case validation fails you want to display
all the error messages together in a message box which control is more suitable to perform this task

Ans: Validationsummary
Q70. You would like to define the number of characters in an input element storing empname fieldto
not exceeding 50 chars which of the following is the correct way to achieve the same

Ans: <input type=”text” id=”empname” maxlength=”50”>

Q71. Identify which of the following events get executed first in the asp.net webforms page lifecycle?

Ans: Page_Init

Q72. For security reason ________ is replaced for cookies in HTML5?

Ans: web storage

Q73. In WPF identify which of the following layout controls aligns the information in the form of rows
and columns?
Ans: Grid

Q74. which of the following is the correct HTML code Snippet you can use to add audio contenton
Html page?
Ans) <audio controls=”controls”>
<source src=”cartoon.mp3” type=”audio/mp3”>
</audio>
Q116. How will the service endpoint inform the service clients about the operations available in the
service?
Ans: using the contract

Q117. Peter is novice developer and has written an application and he wants to test the functionalityof
how the application performs when multiple user access the server at the same time which of the
following test would you suggest Peter to use
Ans: Option B- Load Test

Q124. Choose the design principle in WPF which measures the graphics on specific screen resolution
excluding degree of quality
Ans: Vector Graphics

Q134. Which of the following new elements are added in HTML5?


Ans: option D - All the above

Q141. You are creating a web form using ASP.NET . The web form uses a drop down list called
ddlDepartments to displays a list of departments. The department name(DeptName) is displayed as
the options in the drop down. When the user selects a dept name the corresponding department
id(Deptid) is taken as the value. How will you implement this inASP>NET ?

Ans: ddlDepartments.dataTextField=”DeptName”;ddlDepartments.dataValueField=”DeptId”;

Q142. Consider you are developing an ASP.NET web application you have created a gridview called
“gvCategories”.You need to set two of the below provided options so that the gridview displaysthe
data when viewed in browser.
Which of the following options should you use?

Ans: Datasource and DataBinding

Q143. Consider you are developing an ASP.NET web application. Whenever a user selects a value ina
dropdownlist called ddlEmployees, the application fetches a list of records from the database and
stores them in a data table called "dtEMployee". This data table must be bound to a gridview called
"gvEmployees". Which of the following options will solve the problem?

Ans: b. gvEmployees DataSource=dlEmployee;


c. gvEmployees DataBind();

Q144. Consider the following Srvice Contract


[ServiceContract]
Public interface SearchService
{
[operation Contract]
Int GetJobPositionCount(string description);
Bool UpdateJobPosition(string positionName,int count);
}
How many methods will be visible to clients which have been a reference to the aboveservice?
Ans:

choose the correct statement about stack panel?


Ans: child controls are positioned horizontally or vertically
Which of the following Language is used by WPF programming for UI(User Interface) creation.
Ans: XAML

Endpoint must provide information about the encoding and security specifications….. This is
stored in
Ans: Binding

59)How will you specify method is available to access by client in WCF?


Ans: A-Create an interface marked with the ServiceContract attribute. Add methods in theinterface
and mark them with the OperationContract attribute

You might also like