CS411-Visual Programming UPdated MIDTERM MCQS Solved by Arslan Arshad (Zain Nasar) With Refrence
CS411-Visual Programming UPdated MIDTERM MCQS Solved by Arslan Arshad (Zain Nasar) With Refrence
CS411 QUIZ # 1
2014 and 2015
From (1 to 10) Lectures
Question # 1: A class can inherit from ___________class/classes.
o Two
o Three
o Multiple
Question # 2: During the program execution, program can be stopped with the
help of _________.
o Attributes
o Compiler
o Exception Handling
o Breakpoints Page#47
Question # 3: Types not defined in any namespace are said reside in the
___________ namespace.
o Local
o Static
o Virtual
o Reference
o Pointer
o Integer Argument
o Public
o Static
o Unregistered
o Deleting Events
o Reading Events
o Transforming Events
Question # 7: The result of Exception can bring __________ in the program.
o Reliability
o Stability
o Consistency
The initial name was “Cool”, which stood for “C-like Object Oriented
o Web Application
o Mobile Application
o Desktop Application
Graphical user interfaces and the event-driven model as applied to desktop, web, and mobile
applications.
Question # 10: The easiest way to declare an event is to put the event keyword
in front of a ________ member.
o Interface
o Class
o Struct
Question # 11: Which of the following does NOT include in event processing
operations?
o Deleting Events
o Reading Events
o Transforming Events
Event processing operations include reading, creating, transforming, and deleting events.
o Request
o Response
o Coupling
o Decoupling Page # 13
o Attribute
o Anonymous Page # 53
o None of given
o Non-Anonymous
Anonymous method is a method without a name.
Question # 14: __________ is an entity that receives events from the system.
o Event Producer
o Event Channel
o Event Generator
EVENT CONSUMER: An event consumer is an entity at the edge of an event pro- cessing system that receives
events from the system.
o constants
o variable
o pointers
o Delegates
Question # 16: ________ is an occurrence within a particular system or
domain.
o Function
o Event Page # 10
o Information
o Transaction
o Object
o Event Page # 10
o Result
o Message
o A "catch" block always executes whether or not an exception is thrown and whether or not the
"try" block runs to completion.
o A "finally" block executes only, when an exception is thrown and when the "try" block runs to
completion.
o A "finally" block may or may not executes whether or not an exception is thrown and whether
or not the "try" block runs to completion.
o A "finally" block always executes whether or not an exception is thrown and whether or
not the "try" block runs to completion. click here for more detail
o Copyright
Question # 21: Which of the following is an entity that introduces event into the
system?
o Event Channel
o Event Stream
o Event Consumer
EVENT PRODUCER: An event producer is an entity at the edge of an event process- ing system that introduces
events into the system.
o Double
o Expand
o Reduce Page#46
o Extend
Anonymous methods result in much less code
Question # 23: Which of the following is built from request-response?
o Structure
o Class (Page#14)
o Namespace
o Library
Question # 25: ________ events may or may not relate to an actual occurrence.
o Observed Events
o Deducted Events
Probabilistic events may or may not relate to an actual occurrence e.g. a fraud detection event on a
banking transaction.
Question # 26: Which of the following events may or may not relate to an actual
occurrence?
o Actual Events
o Real Events
o Expected Events
Probabilistic events may or may not relate to an actual occurrence e.g. a fraud detection event on a
banking transaction.
o Probabilistic page # 10
o Event properties
o Layer
o Properties
Probabilistic events may or may not relate to an actual occurrence e.g. a fraud detection event on a
banking transaction.
Question # 28: ___________ method reads the whole document in memory.
o XmlDocument Page # 48
o XmlLine
o XPath
o XmlReader
There are two methods to read XML document. Using XmlDocument and XmlReader.
XmlDocuments reads entire document in memory
o Waiting
o Waste
o Idle
o Blocking Page # 10
Wait for a single event is blocking operation.
Question # 31: The Main method returns a non-zero value which indicates
the_____________.
o Source of Program
o Termination of Program
o Exception in Program
CS411 QUIZ # 2
2014 and 2015
From (11 to 21) Lectures
Question # 32: System.Windows.Controls.Button b = new System.Windows.Controls.Button();
b.Content = "OK"; For the above code (written in C#) the corresponding XAML code will be:
o <Button xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
Content="OK"/> Page # 71
Question # 33: If we want to move an object in the 2-D x-y coordinate system
then which transform class will be used?
o Skew Transform
o Skew Transform
o Rotate Transform
Question # 34: If we want to scale an object in the 2-D x-y coordinate system
then which transform class will be used?
o Rotate Transform
o Matrix Transform
o Skew Transform
Question # 35: Which of the following is/are not derived from “Control” class?
o ListBox
o StatusBar
o Both of above
Question # 36: Which of the following is/are not derived from “Control” class?
o ListBox
o StatusBar
o Both of above
o ListBox
o StatusBar
o Button
o 2012
o 2005
o 2003
Question # 39: Suppose we want to restrict the user to don’t decrease the
height of a WPF element from a specific amount then which property will be
used?
o HeightMinimum
o MinimumHeight
o MinHeight Page # 83
o MaxWidth Page # 91
o MaximumWidth
o WidthMaximum
Question # 41: XAML specification defines rules that map ".NET" namespaces,
types, properties, and events into_______________________. I) XML
namespaces II) XML elements III) XML Attributes
o Only
o Only
o Only
XAML specification defines rules that map .NET namespaces, types, properties, and events into
XML namespaces, elements, and attributes. Lets see XAML and equivalent C#.
Question # 42: Dependency properties are represented by _______________.
o System.Windows.Dependency.Property
o System.Windows.Dependency
o System.Windows.Property.Dependency
Dependency properties are represented by System.Windows.DependencyProperty. By convention, public static and
Property suffix are used.
o Dynamic class
o Normal class
o String class
o May
o May not
o Can
Question # 45: _________ allows to keep the user interface description and
implementation separate.
o GDI
o Avalon
o Altia
WPF allows to keep user interface description and implementation separate.
Question # 46: In context of XAML child element rules, if the child is plain text
and a type converter exists to transform the child into the parent type (and no
properties are set on the parent element), treat the child as the input to the type
converter and use the output as the __________.
o none
If the child is plain text and a type converter exists to transform the child into the parent type (and no properties are set
on the parent element), treat the child as the input to the type converter and use the output as the parent object instance.
Question # 47: We use "UIElement" property ClipToBounds= “True” when
________________________.
o None of given
o CAML:NS
o XAML Page # 77
o XAML:NS
o CAML
BAML is binary application markup language. It just a compressed representation of XAML.
Question # 49: AML is compressed representation of _________.
o CAML:NS
o XAML Page # 77
o XAML:NS
o CAML
Question # 51: “viewbox” element use different types of stretching with the help
of stretch property. There is/are ___________ possible value(s) of stretch.
o 1
o 4
o 2
o 3
Question # 52: BAML stands for:
o Interface imyinterface
{
Void methodtoimplement(); Page # 40
}
o Interface imyinterface
{
Void methodtoimplement
}
o Interface imyinterface
{
Void implement();
}
o Interface imyinterface
{
Void method();
}
Interfaces can also be inherited.
Question # 54: If we want to place a component at top in "dockpanel" then
which one is correct syntax?
o PanelDock="Top"
o Dock="Top"
o DockPanel="Top
Question # 55: Dock panel allows easy docking of elements to an entire side.
o False
Dock panel allows easy docking of elements to an entire side. Dock attached property has left, right, top, bottom values
Question # 56: ________ processing operations include reading, creating, transforming, and deleting
events.
o Observed Events
o Deducted Events
o Probabilistic Events
Common event processing operations include reading, creating, transforming, and deleting events.
Question # 57: The __________ in the namespace indicate a hierarchy of
nested namespaces.
o Arrows
o Semicolon
o Brackets
o Private
o Both of above
The interface forces each component to expose specific public members that will be used in a certain
way.
Question # 59: Static ctor exists to initialize class static members and called
only ________.
o Twice
o Anytime
Static ctor exists to initialize class static members. Its called only once.
Question # 60: Static ctor exists to initialize class static members and has many
parameters.
o True
Static ctor exists to initialize class static members. Its called only once.
o True Page # 40
o False
Question # 63: We want the width of button should cover the whole width of
StackPanel in WPF then what should be value of HorizontalAlignment property of
button?
o Parent
o Whole
o Fill
o Stretch (Page#97)
Question # 64: The root object element in XAML must specify at least ________ XML namespace
that is used to qualify itself and any child elements.
o two
o three
o five
The root object element in XAML must specify at least one XML namespace
Question # 65: In event-driven architecture (EDA), ____________ sends event to ______________.
o True
Auto-implemented properties improve the common-case we saw. Here is the same example using
auot-implemented properties. Properties have the same idea as getters and setters. They just allow
simplified syntax.
COAL
COOP
COAP
COOL (Page#17)
Where do the name for C# comes from. The initial name was “Cool”, which stood for “C-like Object Oriented
Language”.
Question # 68: Events may live ________ events like in event logs.
o Inside
o Both of above
Question # 69: If we run the program from within Visual Studio, the console window disappears
quickly so we can use __________ to keep screen from going away.
o Console.ReadLine() (Page#18)
o Console.WriteLine()
o Console.Title
o Console.Clear
static, instance
public, private
static, private
Question # 71: Mapping to the WPF namespaces is ______________ in-side the WPF assemblies.
Dynamically specified
Different
Alternative
Class
Function
Pointer
o False
Question # 76: Attributes of a program can be queried at run time through __________.
Value
Reference
Extension
Question # 77: Object variables are references to the ________ object not the object themselves.
Original (Page#24)
Alternative
Primary
o False
Question # 79: ________ is built from request-response and it moves away from monolithic
applications.
Both of above
o True
Question # 81: Visual Studio has a snippet called __________ that automatically expands into a
definition of a dependency property, which makes defining one much faster than doing all the typing
yourself!
Property extension
Dpprop
Dependency property
Question # 82: CLI stands for:
Question # 83:________ is said to be stateless if the way it processes one event does not influence the
way it processes any subsequent events.
o Event Producer
o Raw Event
o Event Stream
Question # 84: “FrameworkElement” is the base class that adds support for __________.
o Data binding
o Styles
o Stack
o Pointer
o Function
Question # 86: The using directive can be used to rename a long namespace in the current file.
o True (Page#27)
o False
o False
Question # 88: Cast back to base type to call a/an ________ method of base.
o Instance
o Base Class
o Derived Class
o Abstraction
o Composition
o Association
Question # 90: __________ are inherited by classes which provide the real implementation.
o Functions
o Variables
o Objects
Question # 91: An object initializer is a syntax for initializing a struct without using a ctor.
o False
o Clearance
o Errors
o Ambiguity
Question # 93: Enum of one type may not be ________ assigned to an enum of another type.
o Implicitly (Page#49)
o Explicitly
o Both of above
o 0 (Page#50)
o 1
o 2
o 3
o True
o Arrays
o Variables
o All of these
Question # 97: Derived Event is:
o Generated as a result of event that takes place inside an event processing system.
(Page#11)
Pointer
Variable
Function
Question # 99: Value-types hold their value in ________where they are declared.
Variable
Reference
Object
Question # 100: We can add constructors to a struct and can also overload the default ctor which
initializes everything to default values.
True
False (Page#39)
Question # 101: An initializer list can be used to use an alternate constructor.
o True (Page#28)
o False
Question # 102: C# event is a class member that is ________ whenever the event it was designed for
occurs (fires).
o Deactivated
o Transformed
o Associated
o False
o False
Question # 106: Which of the following statements is TRUE about raw event?
Question # 107: Attributes can be used at design time by application development tools.
o False
Question # 108: Windows Presentation Foundations (WPF) was publicly announced in ________.
o 2000
o 2001
o 2002
o False
Question # 110: Syntax of struct and class are very ________.
o Different
o Large
o Small
o Parameters
o Functions
o Data Members
o Platform, Language
o Package, Language
o Language, Package
o True
o False (Page#43)
o False
o False
Question # 117: The “this” pointer in methods refers to the ________ on which the method is
called.
o Function
o Class
o Pointer
Question # 118: The ______, ________ and ________of applications that use events, either
directly or indirectly is called event-based programming.
Question # 119: Ctor return any values and it initializes class members.
o True
o Transactional
o Functional
o All of these
Question # 121:_________ is an event that is introduced into an event processing system by an event
producer.
o Event Producer
o Event Consumer
o Event Stream
Question # 122: Multiple ________ are conventionally stored in multiple files.
o Functions
o Values
o Variables
o Variables
o Functions
o Classes
Question # 124: _________ are unique types that allow you to assign symbolic names to integral
values.
o Structures
o Typedefs
o Unions
Question # 125: Attributes are generally applied ________ in front of type and type member
declarations.
o Logically
o Both of above
o None of given
o Properties
o Fields
o Finalizers
o False
Question # 128: ________event consumer is an entity at the edge of an event processing system that
receives events from the system.
o Event Producer
o Event Stream
o Constructors
o Destructors (Page#28)
o Both of above
Question # 130: Single Threaded Apartment model is used for communicating with unmanaged COM.
o False
Threaded Apartment model which is used for communicating with unmanaged COM
o Value
o Both of above
Question # 132: ________ can leave your program in an inconsistent state by not releasing resources
or doing some other type of cleanup.
o Functions
o Abstraction
o All of these
Question # 133: Default underlying type of an enum is ________.
o short
o long
o all of these
o False
o Three
o Four
o Five
There are two methods to read XML document. Using XmlDocument and XmlReader.
Question # 136: “out” parameters which are not used for return values or the “params” argument for
variable arguments.
o True
“out” parameters which are used for return values or the “params” argument for variable arguments.
Question # 137: ____________ is a base class similar to UIElement but for document-related pieces
of content that don’t have rendering behavior on their own.
o VisualElement
o SystemElement
o XAMLElement
Question # 138: ________ have already happened whereas ________ are asking something to happen.
o Requests, Events
o Functions, Events
o Requests, Functions
Question # 139: The common type system of C# has ________ types and ________ types.
o Reference, Value
o Function, Data
o Data, Function
Question # 140: ________ operations are completed before the next operation can be started.
o Asynchronous
o Math class
o Program class
o String class
o Functions
o Exception
o Objects
Question # 143: A compiled C# file is called ________.
o Complied File
o Source File
o EXE File
Question # 144: To delcare an anonymous method, you just use keyword “________”.
o handler
o event
o run-time
o anytime
ObsoleteAttribute causes a compile-time warning to appear. Such things would be difficult to accomplish with normal code.
Question # 146: All the members of interfaces are implicitly__________.
o Private
o Static
o Abstract
o Requests
o Functions
o All of these
Question # 148: Markup extensions are invoked from ________ with explicit and consistent syntax.
o C#
o HTML
o Common
o Specialized
o Unique
o Different
o False
Question # 151: Any class, including the same class that the event is declared in, may register one of
its methods with the ________.
o Delegate
o Function
o Class
o True
o Bits
o Line
o Byte
o Stream
Question # 154: Overloaded operators must be static and must be declared in the class for which the
operator is defined.
o False
o Code Block
o Method Block
o Routine Block
o Event-driven
Question # 157: Polymorphism works on the basis that child class should have ______ feature/s of its
parent class.
o Only one
o No
o Few
o All
o Event
o Request
o C#
o HTML
o All of these
o Requests
o Service
o Applications
o Xmlreader
o Both of above
o ReadAll();
o Read(“test.txt”);
o ReadLine();
o Java
o CSS
o C#
o Dev C++
o Decode
o Harder
o Simplify
o Refactor
Question # 167: To use kbhit() command, you need to include which header file in your program?
o fstream.h
o stdio.h
o iostream.h
o Information
o Entity
o Object
o Event page # 10
Question # 169: Wpf 3.5 released in__________.
o 2005
o 2006
o 2009
o Reaction page # 10
o Class
o Object
o Action
o Specialized
o Composed
o Generalized
Question # 172: A (n) _____________is a subscription mechanism for events.
o Raw Event
o Event Stream
o Event Producer
Question # 173: The default constructor initializes the integers with ___________ value.
o Empty
o NULL
o Zero (0)
o One (1)
o An interface can contain only methods, properties, events, and indexers. Page # 40
Question # 175: Not implementing some methods of the interface in the class is _________________.
o An error page # 40
o Acceptable
o A warning
o An exception
Question # 176: _________ Method is used to move the file from one directory to another.
o Move page # 63
o Export
o Import
Question # 177: Unlike type converters, however, markup extensions are invoked from XAML with
___________.
o Bridge assemblies
o Wrapper code
o Four
o Three Page 73
o Two
o One
Question # 179: Which of the following grabs the “OK” button by only knowing its name?
Question # 180: The only __________ .Net language has an intrinsic understanding of dependency
Properties.
o Vb.net
o C#
o J#
o Xaml page # 83
Question # 181: There is/are _____ type(s) of padding in WPF element.
o One
o Two
o Four
Question # 182: If we require to set components in table (column and row) format, then which panel
will be used?
o StackPanel
o TabPanel
o DockPanel
o 3
o 2
o 1 page # 104
o 0
Question # 184: What is the default value of "ColumnSpan" property of "Dockpanel"?
o 2
o 1 page # 104
o 0
o 3
o 0
o False
o True
o Event Consumer
o Event Producer
o Event Channel
Question # 187: Which of the following is not a feature of "C#"?
o Virtual
o Input
o Static page # 18
o Dynamic
o "Struct" can add methods like interfaces and can be called in exactly the same way.
o "Interfaces" can add methods like classes and can be called in exactly the same way.
o "Struct" can add methods like classes and can be called in exactly the same way. Page # 39
o "Struct" cannot add methods like classes and cannot call in exactly the same way.
Four (4)
One (1)
Two (2)
Question # 191: XML document is readable by _____________.
o No one
o Human only
o Machine only
o Three page 76
o Two
o One
o Four
Question # 193: One of the key goals of WPF and XAML is the separation of
____________________.
o Factory method
o Sequential heap
o XAML compiler
Question # 195: Which "transform" property can help us to flip the element from its center?
o ScaleY
o ScaleX
Question # 196: By convention "tunneling event" names are prefixed with ________ and just
come_________ the bubbling event occurs.
o View, after
o View, before
o Preview, after
Question # 197: Stylus can behave like a ___________ but has ___________resolution.
o Keyboard, lower
o Mouse, lower
o Keyboard, higher
Question # 198: Which one is the correct syntax for declaring attribute?
o [Obsolete] page # 48
o {Obsolete}
o (Obsolete)
o *Obsolete
Question # 199: The corresponding type converter class for “Brush” class will be _________.
o CastBrush
o BrushCast
Question # 200: The elements in a/an _________ are always stored in a contiguous block of memory.
o Tree
o Array
o Variable
o Struct
Question # 201: The ________ statement iterates over each element in an "enumerable" object.
o Dowhile
o While
o For
Question # 202: You can handle multiple exception types with multiple _________ clauses.
o Throw
o Finally
o Catch
o Try
Question # 203: A ____________ block has access to an "Exception" object that contains information
about the error.
o Throw page 46
o Catch
o Try
o Finally
Question # 204: Attributes are declared ________ the class/function.
o Within
o After
o Above
o Outside
Question # 205: Whenever an attribute value is enclosed in curly braces "{}", the XAML
compiler/parser treats it as a/an _________ rather than a/an __________.
Question # 206: If we want that "Stretch" property of child element takes the available "height or
width of parent" and shape of child element doesn’t change, then we should write “Stretch =
________”.
o 1
o UniformToFill
o Uniform
Question # 207: Which of the following is Not a routing strategy?
o Tunneling
o Bubbling
o Direct
Question # 208: We are checking that whether an element is eligible for focus or not, which property
will help us in this testing?
o Focus
o IsFocus
o IsFocusable
o Event Request
o Event Response
o Event Architecture
Question # 210: In C#, comments are written using ________________.
o # and */ /*
o // and /* */ page18
o # and /*
o // and */ /*
Question # 211: C# is most often used with some implementation of the ________________.
o System.Collections.Generic
o System.Reflection
o System.Text
o System.IO
Question # 213: In Visual Studio 2012, expression blend is _________ WPF feature.
o 80%
o 100% Page # 69
o 90%
o 70%
WPF and expression blend is 100% WPF and is great for designing and prototyping WPF apps.
Question # 214: For which of the following, WPF does not provide any type converter?
o Color
o Point
o FontWeight
Question # 215: We have two buttons "b1" and "b2". If we want to place "b1" on "b2" then value of
"ZIndex" of "b1" should be ______ the value of "ZIndex" of "b2".
o Less than
o Greater than
o Equal to
o Event properties
o Layer
o Properties
o Routed Events
o Output Events
o Obvious Events
Question # 218: __________where multiple GUI elements and many sources of events exist.
o Event properties
o Content property
o Event properties
o Layer
o Output Events
Question # 220: Methods are __________that operate on data.
o Algorithms page # 37
o Variable
o Pointer
o Function
Question # 221: When your C# program is compiled, it creates a file called a/an______, which is
normally an executable or DLL library.
o C++
o Assembly page # 41
o Text
o BIOS
o Function
o Method
o Value
o Positional page # 43
Question # 223: Graphical user interfaces and the event-driven model are not applied on which of the
following?
o Web Applications
o Console Applications
o Mobile applications
o Desktop Applications
Question # 224: WPF element in "DockPanel" has property "dock". There is/are __________ possible
value(s) of "dock" property.
o two
o three
o one
Question # 225: In context of XAML child element rules, if the parent supports a content property and
the type of the child is compatible with that property, treat the child as its __________.
o Super class
o Sub class
o Interface
Question # 226: The _______________ user interfaces, enabled by WPF, is getting a lot of attention.
o Loutish
o Coarse
o Distracted
Question # 227: With the help of WPF, an ugly looking application can be _______ by the designers.
o Rearranged
o Re-created
o Rejected
Question # 228: If we want to rotate an object clockwise about a specified point in a 2-D x-y
coordinate system then which transform class will be used?
o Translate Transform
o Skew Transform
o Scale Transform
Question # 229: All elements of WPF have following property/properties.
o Width
o Height
Note: If you found any mistake in Mcqz please mail at above mentioned email
address. And tell me your answer with references.