Skip to main content

Event-Driven Programming Practice Questions - 1353 Verified Questions

Page 1


Event-Driven Programming Practice Questions

Course Introduction

Event-Driven Programming focuses on the development of software applications that respond to user actions, sensor outputs, or other events rather than following a strictly sequential flow. In this course, students explore the principles and techniques underlying event-driven architectures, including the use of event handlers, listeners, and callbacks. Emphasis is placed on designing interactive graphical user interfaces (GUIs) and handling asynchronous operations commonly found in modern applications. Through hands-on assignments and projects, students learn to implement event-driven solutions using popular programming languages and frameworks, preparing them for developing responsive and interactive software systems in various domains.

Recommended Textbook

Visual C# How to Program 6th Edition by Paul J. Deitel

Available Study Resources on Quizplus

25 Chapters

1353 Verified Questions

1353 Flashcards

Source URL: https://quizplus.com/study-set/2449

2

Chapter 1: Introduction to Computers, the Internet and Visual C#

Available Study Resources on Quizplus for this Chatper

49 Verified Questions

49 Flashcards

Source URL: https://quizplus.com/quiz/48667

Sample Questions

Q1) Java enables you to write programs that will run on a great variety of computer systems and computer-control devices.

A)True

B)False

Answer: True

Q2) Visual C# programs are created using Microsoft's Visual Studio-a collection of software tools called a(n)________.

A) operating system

B) Integrated Programming Environment

C) Integrated Development Environment

D) Class Library.

Answer: C

Q3) Secondary storage stores data for large amounts of time.

A)True

B)False

Answer: True

Q4) C# is an object oriented language that has roots in C,C++ and Java.

A)True

B)False

Answer: True

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Dive Into Visual Studio Community

Available Study Resources on Quizplus for this Chatper

25 Verified Questions

25 Flashcards

Source URL: https://quizplus.com/quiz/48668

Sample Questions

Q1) Commands for managing the IDE and for developing,maintaining and executing programs are contained in the menus,which are located on the menu bar.

A)True

B)False

Answer: True

Q2) This menu contains commands for opening projects,closing projects,printing project data,etc.

A) View menu

B) Edit menu

C) Tools menu

D) File menu

Answer: D

Q3) Dragging and dropping predefined building blocks into place is part of visual programming in C#.

A)True

B)False

Answer: True

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Introduction to C# Apps

Available Study Resources on Quizplus for this Chatper

41 Verified Questions

41 Flashcards

Source URL: https://quizplus.com/quiz/48669

Sample Questions

Q1) C# is case insensitive,therefore an identifier named Pencil is the same as one named pencil.

A)True

B)False

Answer: False

Q2) _________ are violations of language rules.

A) Logic errors

B) Syntax errors

C) Run-time errors

D) None of the above.

Answer: B

Q3) Which of the following represents multiplication

A) *

B) /

C) %

D) ^

Answer: A

To view all questions and flashcards with answers, click on the resource link above.

Page 5

Chapter 4: Introduction to Classes,Objects,Methods and Strings

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/48670

Sample Questions

Q1) The property notation allows the client to directly manipulate the private instance variable.

A)True B)False

Q2) Most instance variables are declared ________.

A) public B) protected C) private D) None of the above.

Q3) You should think of a C# class's attributes as instance variables.

A)True B)False

Q4) The following code:

Account account1 = new Account("Jane Green"); passes the string argument "Jane Green" to the Account object's Account method.

A)True B)False

Q5) C# is case sensitive,so Name and name are distinct identifiers. A)True B)False

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Control Statements: Part 1

Available Study Resources on Quizplus for this Chatper

94 Verified Questions

94 Flashcards

Source URL: https://quizplus.com/quiz/48671

Sample Questions

Q1) Local variables must be ________.

A) initialized when they are declared.

B) initialized before their values are used in an expression.

C) declared and initialized in two steps.

D) declared at the top of the method.

Q2) Which of the following is not a benefit of "goto-free programs"

A) easier to debug and modify

B) shorter

C) clearer

D) more likely to be bug free

Q3) The best way to use braces is to go back and insert them after all the code has been written.

A)True

B)False

Q4) The operator increases the value of the variable by 1 after the original value is used in the expression in which the variable appears.

A) preincrement

B) postincrement

C) predecrement

D) None of the above.

Page 7

To view all questions and flashcards with answers, click on the resource link above.

Chapter 6: Control Statements: Part 2

Available Study Resources on Quizplus for this Chatper

66 Verified Questions

66 Flashcards

Source URL: https://quizplus.com/quiz/48672

Sample Questions

Q1) The initialization expression,condition and increment expression in a for statement's header must be separated with commas.

A)True

B)False

Q2) A default case must be provided for every switch statement.

A)True

B)False

Q3) Unary operators (such as ++)cannot be used in conditions.

A)True

B)False

Q4) The logical exclusive OR operator is true if it at least one of its operands is true.

A)True

B)False

Q5) The stacking and nesting rules must be applied in a specific order.

A)True

B)False

Q6) If a while condition is never true,the body will never execute.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Methods: a Deeper Look

Available Study Resources on Quizplus for this Chatper

95 Verified Questions

95 Flashcards

Source URL: https://quizplus.com/quiz/48673

Sample Questions

Q1) The return type of a method's return value is specified in the method call.

A)True

B)False

Q2) A recursive method knows directly how to solve only the base case.

A)True

B)False

Q3) If a change is made to an underlying value in an enumeration,you must change the pro gram in every place that the old value was used.

A)True

B)False

Q4) _________ methods can be called without the need for an object of the class to exist.

A)special

B)independent

C)static D)dependent

Q5) Improperly defining a recursive method may result in infinite recursion. A)True B)False

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Arrays;Introduction to Exception Handling

Available Study Resources on Quizplus for this Chatper

90 Verified Questions

90 Flashcards

Source URL: https://quizplus.com/quiz/48674

Sample Questions

Q1) When dealing with multi-dimensional arrays,each "row" must be the same size.

A)True

B)False

Q2) Constant variables also are called.

A) write-only variables

B) finals

C) named constants

D) All of the above

Q3) [C#6] Initializing an auto-implemented property in its declaration is a C# 6 feature known as auto-property initializers.Which of the following is the general syntax for a read-write auto-implemented property with an initializer

A)Type PropertyName {get,set;} = initializer;

B)Type PropertyName {get | set} = initializer;

C)Type PropertyName {get;set} = initializer;

D)Type PropertyName {get;set;} = initializer;

Q4) An array must be declared and allocated in the same statement.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Introduction to Linq and Generic Collections

Available Study Resources on Quizplus for this Chatper

27 Verified Questions

27 Flashcards

Source URL: https://quizplus.com/quiz/48675

Sample Questions

Q1) A List< T > can automatically resize itself to accommodate additional elements.

A)True

B)False

Q2) A generic method does not need an object of the class in order to execute.

A)True

B)False

Q3) In a LINQ query,the where clause specifies          .

A) the data source

B) where to put the data

C) the condition(s) for including the item

D) the Location property

E) the data type

Q4) LINQ is used to query collections in the same way it's used to query arrays.

A)True

B)False

Q5) A LINQ query is executed when it's created.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Classes and Objects: A Deeper Look

Available Study Resources on Quizplus for this Chatper

79 Verified Questions

79 Flashcards

Source URL: https://quizplus.com/quiz/48676

Sample Questions

Q1) The Object Browser _____________.

A) lists all the classes in the C# library

B) describes the functionality provided by a specific class C) is separated into 3 frames

D) All of the above.

Q2) C#6] It's common to include in an exception's error message a variable's or property's identifier.This information can help a client-code programmer understand the context in which the exception occurred.Prior to C# 6,you had to hard code these identifiers into your error-message strings.As of C# 6,you can instead use the ________ operator,which returns a string representation of the identifier enclosed in parentheses.

A) valueof

B) stringof

C) characterof

D) nameof

Q3) A class cannot have references to objects of other classes as members.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above.

Chapter 11: Object-Oriented Programming: Inheritance

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

Source URL: https://quizplus.com/quiz/48677

Sample Questions

Q1) A class inherited from two or more levels up in the hierarchy is known as a

A) indirect base class

B) direct base class

C) superclass

D) None of the above

Q2) If a base class constructor is overridden,the original constructor can no longer be called explicitly by the derived class.

A)True

B)False

Q3) An advantage of inheritance is that:

A) all methods can be inherited

B) all instance variables can be uniformly accessed by base classes and derived classes

C) Objects of a derived class can be treated like objects of their base class

D) None of the above.

Q4) The process of abstraction allows you to focus on the commonalities among objects in the system.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 13

Chapter 12: Object-Oriented Programming: Polymorphism

Available Study Resources on Quizplus for this Chatper

62 Verified Questions

62 Flashcards

Source URL: https://quizplus.com/quiz/48678

Sample Questions

Q1) An interface reference may invoke only the methods that the interface declares.

A)True

B)False

Q2) Which is used to specify that a class will be implementing an interface

A) using

B) :

C) implements

D) extends

Q3) If a method needs to be called polymorphically,what type of reference should be used to point to the object that the method is being called with

A) a reference of the base class that defines the behavior of the object

B) a reference of the same type as the object

C) an object reference to the actual object

D) None of the above.

Q4) Abstract classes may not be:

A) inherited

B) accessed by derived-classes

C) instantiated

D) None of the above.

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Exception Handling: A Deeper Look

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

Source URL: https://quizplus.com/quiz/48679

Sample Questions

Q1) A catch block can use a concise notation to catch exceptions related by inheritance.

A)True

B)False

Q2) The base class for all exception classes is System.Exception.

A)True

B)False

Q3) The Message property of an exception is what is displayed to the user should that exception be thrown.

A)True

B)False

Q4) By convention,the name of each user-defined exception should end with Exception.

A)True

B)False

Q5) If an exception handler is to catch a variety of exceptions,use a comma-separated list of catch arguments in the catch handler.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 15

Chapter 14: GUI With Windows Forms: Part 1

Available Study Resources on Quizplus for this Chatper

64 Verified Questions

64 Flashcards

Source URL: https://quizplus.com/quiz/48680

Sample Questions

Q1) You can use the Tab property to determine the order in which tab bing will occur.

A)True B)False

Q2) By looking up ControlName class and clicking the events section,you can find out all the events and the parameters a control has.

A)True B)False

Q3) Using the CheckState property you can determine whether the CheckBox is checked. A)True B)False

Q4) All of the controls and components can be found in the tool box. A)True B)False

Q5) What is a tool tip useful for A)tip of the mouse is blinks while hovering over an item in a GUI

B)the tip of the mouse is highlighted while hovering over an item in a GUI

C)displays helpful text under the mouse while hovering over an item in a GUI

D)All of the above

To view all questions and flashcards with answers, click on the resource link above. Page 16

Chapter 15: GUI With Windows Forms: Part 2

Available Study Resources on Quizplus for this Chatper

73 Verified Questions

73 Flashcards

Source URL: https://quizplus.com/quiz/48681

Sample Questions

Q1) Each TabPage on the form must use the same event triggers.

A)True

B)False

Q2) Class CheckedListBox derives from class ListBox and contains similar properties.

A)True

B)False

Q3) A tree is a hierarchical collection of child and parent nodes.

A)True

B)False

Q4) In order to create an MDI Form the programmer has to enable that form to be an MDI container.

A)True

B)False

Q5) An example of a ListView is the right side of windows explorer.

A)True

B)False

Q6) The SelectedIndex property returns the index of the selected item. A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 17

Chapter 16: Strings,Characters and Regular Expressions

Available Study Resources on Quizplus for this Chatper

92 Verified Questions

92 Flashcards

Source URL: https://quizplus.com/quiz/48682

Sample Questions

Q1) Concatenating two strings merges the two strings into another string.

A)True

B)False

Q2) Method Insert can be used only on the primitive data types.

A)True

B)False

Q3) If an IndexOfAny method is passed an array of characters it:

A) finds the first occurrence of each letter in the string

B) searches for the first occurrence of any of the characters in the string

C) will search for the first occurrence of the sequence of characters

D) generates an error

Q4) To create a string literal that excludes escape sequences,use:

A) !"string"

B) @"string"

C) #"string"

D) $"string"

Q5) The ToUpper and ToLower methods can be used to convert a string to all upper or lower case letters,respectively.

A)True

B)False

18

To view all questions and flashcards with answers, click on the resource link above.

Chapter 17: Files and Streams

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/48683

Sample Questions

Q1) When a FileStream object is opened,the file-position pointer is _________.

A)set to Null

B) set to 0

C) needs to be explicitly created

D) set to the end of the file

Q2) Method GetFiles of class Directory can be used to display all the files in a given directory.

A)True

B)False

Q3) BinaryFormatter's Serialize and Deserialize methods are both parameterless.

A)True

B)False

Q4) A recursive search on a directory is one where:

A) a directory is searched and then all of its sub directories are searched.

B) each sub directory is searched and then the main directory is searched.

C) a search is done randomly on all directories.

D) a and c.

E) a and b

To view all questions and flashcards with answers, click on the resource link above. Page 19

Chapter 18: Searching and Sorting

Available Study Resources on Quizplus for this Chatper

19 Verified Questions

19 Flashcards

Source URL: https://quizplus.com/quiz/48684

Sample Questions

Q1) At the ith iteration of the insertion sort algorithm,the array will be sorted.

A)True

B)False

Q2) The merge sort algorithm sorts an array by splitting it into two equal-sized subarrays,sorting each subarray and merging them in one larger array.

A)True

B)False

Q3) What is the efficiency of selection sort

A) O(n2)

B) O(n log n)

C) O(n)

D) O(1)

Q4) A linear search algorithm will always search each and every element.

A)True

B)False

Q5) After the ith iteration of an ascending order selection sort,the smallest i items of the array will be sorted in increasing order in the first i elements of the array.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 20

Chapter 19: Data Structures

Available Study Resources on Quizplus for this Chatper

28 Verified Questions

28 Flashcards

Source URL: https://quizplus.com/quiz/48685

Sample Questions

Q1) Which is not a typical application of queues

A) Routing packets in a computer network

B) File server handling file access requests from many clients

C) High-speed sorting

D) Print spooling

Q2) Like linked lists,stacks,and queues,trees are also linear data structures.

A)True

B)False

Q3) In a circular linked list,each node is connected to every other node.

A)True

B)False

Q4) Which statement about trees is false

A) A tree is a nonlinear, two-dimensional data structure.

B) Each node in a tree must contain two links.

C) Children of the same node are called siblings.

D) A node with no children is called a leaf node.

Q5) Boxing can be either implicit or explicit.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 21

Chapter 20: Generics

Available Study Resources on Quizplus for this Chatper

22 Verified Questions

22 Flashcards

Source URL: https://quizplus.com/quiz/48686

Sample Questions

Q1) A ________ provides a means for describing a class in a type-independent manner.

A) subclass

B) generic class

C) concrete class

D) parameterized class

Q2) Type constraints restrict the type of the argument supplied to a particular type parameter.

A)True

B)False

Q3) Which statement is false

A) Each type parameter list contains one or more type parameters, separated by commas.

B) A type parameter name must be unique among different generic methods.

C) The type parameters act as placeholders for the types of the arguments passed to a method.

D) The type parameter names throughout the method declaration must match those declared in the type parameter list.

Q4) It's not possible to apply multiple constraints to a type parameter.

A)True

B)False

22

To view all questions and flashcards with answers, click on the resource link above.

Chapter 21: Collections

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/48687

Sample Questions

Q1) A _______ is the general term for a collection of key-value pairs.

A) book

B) glossary

C) dictionary

D) lexicon

Q2) C# 6's using static directive ________.

A) converts each of a class's methods to static.

B) converts the class to static.

C) allows access to a class's static members without fully qualifying their names.

D) None of the above.

Q3) The compiler converts LINQ queries into calls to ________,many of which have delegate parameters.

A) instance methods

B) constructors

C) extension methods

D) void methods

Q4) Enumerators can be used to modify the contents of collections.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 23

Chapter 22: Databases and LING

Available Study Resources on Quizplus for this Chatper

25 Verified Questions

25 Flashcards

Source URL: https://quizplus.com/quiz/48688

Sample Questions

Q1) A primary key must be unique for each record in the relational database table.

A)True

B)False

Q2) An ADO.NET Entity Data Model cannot represent the relationships between tables in a database.

A)True

B)False

Q3) It's possible to select only a subset of a relational database table's columns.

A)True

B)False

Q4) There is a ____________ relationship between a primary key and its corresponding foreign key.

A) one-to-one

B) foreign

C) one-to-many

D) structural

Q5) Database management systems enable you to access and store data without worrying about the external representation of databases.

A)True

B)False

Page 24

To view all questions and flashcards with answers, click on the resource link above.

Chapter 23: Asynchronous Programming With Async and Await

Available Study Resources on Quizplus for this Chatper

37 Verified Questions

37 Flashcards

Source URL: https://quizplus.com/quiz/48689

Sample Questions

Q1) Visual C# apps can have multiple threads of execution,where each thread has its own ________ stack,allowing it to execute concurrently with other threads while sharing with them application-wide resources such as memory and processors.This capability is called multithreading.

A) method-call

B) attribute

C) memory

D) application

Q2) Task static method ________ enables you to wait for any one of several Tasks specified as arguments to complete-the method returns the Task that completes first.

A) FirstToComplete

B) AnyMethod

C) OneOfSeveral

D) WhenAny

Q3) An async method executes its body in ________.

A) the calling method

B) the called method

C) the main method

D) the same thread as the calling method

To view all questions and flashcards with answers, click on the resource link above. Page 25

Chapter 24: XML

Available Study Resources on Quizplus for this Chatper

72 Verified Questions

72 Flashcards

Source URL: https://quizplus.com/quiz/48690

Sample Questions

Q1) If the URI given to a namespace is a URL,the URL needs to refer to an actual web page and must conform to proper URL syntax.

A)True

B)False

Q2) Schemas are XML documents that conform to a DTD.

A)True

B)False

Q3) Limitations of schemas have led to the development of DTD's.

A)True

B)False

Q4) XML does not allow for empty elements.

A)True

B)False

Q5) Which of the following is not a technology of XSL ?

A) XSL-FO: vocabulary for specifying formatting

B) XPath: string-based language of expressions used by XML

C) XSLT: transforms XML documents into other documents

D) XLib: library to help develop new stylesheets

To view all questions and flashcards with answers, click on the resource link above. Page 26

Chapter 25: GUI With Windows Presentation Foundation

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

Source URL: https://quizplus.com/quiz/48691

Sample Questions

Q1) The StartupUri attribute defines which XAML document loads first.

A)True

B)False

Q2) WPF graphics are resolution-independent,meaning that they're designed to look similar on screens of different sizes.

A)True

B)False

Q3) A WPF Grid control allows child elements to be positioned using explicit coordinates.

A)True

B)False

Q4) Which of the following is not a data provider for WPF data binding

A) ObjectDataProvider

B) SqlDataProvider

C) XmlDataProvider

D) None of the above.

Q5) A bubbling event travels down the container hierarchy,and a tunneling event travels up the container hierarchy.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 27

Turn static files into dynamic content formats.

Create a flipbook