Skip to main content

Object-Oriented Programming Mock Exam - 1353 Verified Questions

Page 1


Object-Oriented Programming

Mock Exam

Course Introduction

Object-Oriented Programming introduces students to the fundamental concepts and principles of object-oriented design and development. The course covers key topics such as classes, objects, inheritance, polymorphism, encapsulation, and abstraction, while emphasizing code reusability, modularity, and maintainability. Students will apply these concepts using a modern programming language, developing practical skills in designing, implementing, and testing object-oriented software. Through hands-on assignments and projects, students gain experience solving real-world problems and understanding the advantages of object-oriented methodologies in software engineering.

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 Page 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) Which of the following statements is false

A) Cloud computing allows you to use software, hardware and information stored in the "cloud"-i.e., accessed on remote computers via the Internet and available on demand-rather than having it stored on your personal computer.

B) Cloud computing services allow you to increase or decrease resources to meet your needs at any given time, so they can be more cost effective than purchasing expensive hardware to ensure that you have enough storage and processing power to meet your needs at their peak levels.

C) Businesses using cloud computing services must still manage the applications, which can be costly.

D) Both (a) and (c).

Answer: C

Q2) The smallest data item in a computer is the _________.

A) bit

B) byte

C) kilobyte

D) None of the above.

Answer: A

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) Microsoft provides extensive help documentation via the __________ menu.

A) Assist

B) Aid

C) Support

D) Help

Answer: D

Q2) The Microsoft Developers Network (MSDN)online library provides:

A) tutorials

B) articles

C) downloads

D) All of the above.

Answer: D

Q3) The View menu:

A) Contains commands for displaying IDE windows and toolbars

B) Contains commands for arranging a form's controls.

C) Contains commands for managing a project and its files.

D) Contains commands for compiling a program.

Answer: A

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) Namespaces group various C# features into related categories.

A)True

B)False

Answer: True

Q2) Where can't you see errors

A)The line where the error occurred

B)The Error List window

C)The Solution window

Answer: C

Q3) The Parameter Info window indicates how many versions of the selected method are available.

A)True

B)False Answer: True

Q4) An assignment statement is evaluated from left to right.

A)True

B)False

Answer: False

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) Consider the code: Public void SetName(string accountName)

{ Name = accountName;// store the account name }

Which of the following statements is false

A) The first line of each method declaration is the method header.

B) The method's return type (which appears to the left of the method's name) specifies the type of data the method returns to its caller after performing its task.

C) The return type void indicates that when SetName completes its task, it does not return any information to its calling method.

D) A method requires one or more parameters that represent the data it needs to perform its task.

Q2) It's always better to get the errors out of your programs at execution time,if possible,rather than at compilation time.

A)True

B)False

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

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) Counter-controlled repetition is often called definite repetition because the number of repetitions is known before the loop begins executing.

A)True

B)False

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) is C#'s only ternary operator.

A) *

B)\(?:\)

C) =

D) //

Q4) Which of the following generates a syntax error

A) c *= 3;

B) c %= 2;

C) c /= 4;

D) None of the above.

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

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) Which of the following statements is true

A) strings can be used in switch expressions, but string literals cannot be used in case labels.

B) strings cannot be used in switch expressions, but string literals can be used in case labels.

C) strings can be used in switch expressions, and string literals can be used in case labels.

D) strings cannot be used in switch expressions, and string literals cannot be used in case labels.

Q2) Modifying the control variable of a for statement in the body can cause errors. A)True B)False

Q3) The for repetition statement handles the details of counter-controlled repeti tion.

A)True B)False

Q4) A variable used as a counter should be initialized when it's declared.

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) Repeating high-quality,high-performance code in a program helps ensure higher qual ity programs.

A)True

B)False

Q2) A(n)conversion occurs when a type is converted to a type that can hold more data. A) implicit B) widening C) explicit D) None of the above.

Q3) The technique of dividing large programs into simple problems is known as divide and conquer.

A)True

B)False

Q4) Methods defined by the programmer may consist only of predefinedNET method calls.

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) Which foreach header represents iterating through an array of int named numbers

A)foreach (numbers)

B) foreach (number in numbers)

C) foreach (int number in numbers)

D) foreach (int number in int[] numbers)

Q2) [C#6] Which of the following statements is false

A)Prior to C# 6,auto-implemented properties required both a get and a set accessor.

B)Client code can use C# 6 getter-only auto-implemented properties only to get each property's value.

C)C#6 getter-only auto-implemented properties are read only.

D)C#6 getter-only auto-implemented properties can be initialized only in their declarations.

Q3) Attempting to access an array element out of the bounds of an array causes a(n)________.

A) ArrayOutOfBoundsException.

B) ArrayElementOutOfBoundsException.

C) IndexOutOfRangeException.

D) ArrayException.

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) 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

Q2) The ________ extension method is returns the number of results in a LINQ query.

A) Any

B) First

C) Count

D) None of the above

Q3) Visual C# requires you to write SQL to query data sources.

A)True

B)False

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

A)True

B)False

Q5) You can sort a LINQ query's results only by one property. A)True

B)False

11

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

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) Object initializers (which initialize an object and its properties)use what syntax

A) new className(property1 - > value1, );

B) new className(property1 = value1, );

C) new className{property1 = value1, };

D) className{property1 = value1, };

Q2) Composition is sometimes referred to as a(n)________.

A) is-a relationship

B) has-a relationship

C) have-a relationship

D) one-to-many relationship

Q3) An attempt by a method which is not a member of a particular class to access a pri vate member of that class is a fatal runtime error.

A)True B)False

Q4) A static method may access static and non-static 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) Inheritance is the process of building a class with object references of other classes.

A)True

B)False

Q2) A "copy-and-paste" approach is a simple and efficient way from a software-engineering perspective of providing func tionality that exists in other classes.

A)True

B)False

Q3) A method must be declared

__________ for it to be overridden by derived classes.

A) overrides

B) overridable

C) virtual

D) None of the above

Q4) The protected members of a class may be accessed in their base class or any classes derived from that base class.

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 abstract class may be derived from another abstract class.

A)True

B)False

Q2) Declaring an interface protected allows for extra security precautions.

A)True

B)False

Q3) A class that implements an interface may not act as a base class for other classes.

A)True

B)False

Q4) Assigning a derived class reference to a base class variable is safe:

A)because the derived class has an object of its base class.

B)because the derived class is an object of its base class.

C)only when the base class is abstract.

D)only when the base class is concrete.

Q5) All of the following methods are implicitly sealed except:

A) a method in an abstract class.

B) a private method.

C) a method declared in a sealed class.

D) static method.

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) C# does not guarantee that a finally block (if one is present)will be executed if a try block is exited via a return,break or continue statement.

A)True

B)False

Q2) Which of the following statements is true

A) The code in a finally block is executed only if an exception occurs.

B) The code in a finally block is executed only if an exception does not occur.

C) The code in a finally block is executed only if there are no catch blocks.

D) None of the above are true.

Q3) In C#,after an exception is handled,control resumes.This is known as the model of exception handling.

A) after the last catch block, termination

B) after the last catch block, resumption

C) just after the throw point, termination

D) just after the throw point, resumption

Q4) All exceptions cause the program to terminate when thrown.

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) What does the ReadOnly property indicate

A)the number of the control cannot change

B)the user cannot click the buttons to select a number into the control

C)the user cannot type data into the control

D) all of the above

Q2) All buttons,including checkboxes and radiobuttons,are derived from class Button.

A)True

B)False

Q3) The AutoSize property is used to:

A) change the size of the image to fit the PictureBox

B) change the size of the PictureBox to fit the image

C) find a medium between the PictureBox and the actual picture

D) make the picture as large as possible while still maintaining quality

Q4) The StretchImage property is used to:

A) change the size of the image to fit the PictureBox

B) change the size of the PictureBox to fit the image

C) find a medium between the PictureBox and the image

D) make the picture as large as possible while still maintaining quality

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) Inheriting a form can be difficult in C#.

A)True

B)False

Q2) Which of the following statements are true about menus created through C#

A)Provide groups of related commands for Windows apps.

B)Organize commands without cluttering the GUI

C)Have the capacity to create shortcuts for the menu commands

D)All of the above

Q3) The MultiLine property determines whether tabs can fill more than one row or not.

A)True

B)False

Q4) The MaxDropDownItems property

A) sets the maximum number of items the list can hold

B) creates a scrollbar on the list after it exceeds the set max

C) creates a max to how many items the user can add to the list

D) can be set from 1 to 1000

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

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) ToUpper(string)is

A) a way of converting a string to all upper cases.

B) a way to make the first letter of every word in a string a capital letter.

C) a way of making one string more important than the rest.

D) a syntax error.

Q2) A lazy quantifier will return only the first case that matches the specifica tions.

A)True

B)False

Q3) The LastIndexOfAny method scans through the array of characters backwards. A)True

B)False

Q4) Characters consist of only the capital and lowercase letters.

A)True

B)False

Q5) To make a search return between 10 and 20 results use

A) { 10, 20 }

B) (10, 20)

C) [ 10, 20 ]

D) < 10, 20 >

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) Which of the following methods of FileStream will reset the file-position pointer back to the beginning of the file

A)Reset

B) Origin

C) Seek

D) Beginning

Q2) .NET provides class _______ for manipulating files.

A) Folder

B) FileUtil

C) File

D) FileManip

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

A)True

B)False

Q4) BinaryFormatter allows only for reading objects.

A)True

B)False

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) If the search key is not in an array of 10 elements,how many comparisons must the linear search algorithm make

A) 0

B) 10

C) 9

D) 5

Q2) Insertion sort is a simple and inefficient algorithm.

A)True

B)False

Q3) O(1)means that the algorithm has a constant run time.

A)True

B)False

Q4) The Big O Notation measures the average case run time of an algorithm.

A)True

B)False

Q5) What is the efficiency of linear search

A) O(1).

B) O(log n).

C) O(n).

D) O(n2).

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) C# programs must explicitly release dynamically allocated memory.

A)True

B)False

Q2) Usually a _________ indicates to a program the end of a data structure.

A) backslash character

B) forward slash character

C) null reference

D) null pointer

Q3) Which statement is false

A) When a method call is made, the called method must know how to return to its caller, so the return address is pushed onto the program execution stack.

B) Stacks support recursive method calls in the same manner as conventional, nonrecursive method calls.

C) The program execution stack contains the space created for a method's global variables on each invocation of that method during a program's execution.

D) When a method returns to its caller, the memory for that method's local variables is popped off the stack and those variables are no longer known to the program.

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

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 generic method can be overloaded by ________ method.

A) a non-generic method

B) a generic method

C) a and b

D) None of the above

Q2) The type constraints determine the operations that can be performed on the type parameters.

A)True

B)False

Q3) A type parameter _____________.

A) is an identifier that is used in place of an actual type name

B) can be used to declare the return type

C) acts as a placeholder for the type of an argument passed to the generic method

D) All of the above

Q4) You can use explicit type arguments to indicate the exact type that should be used to call a generic method (e.g.,< int >).

A)True

B)False

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

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) Classes which implement the IEnumerator interface must contain which of the following methods

A.MoveNext

B.Reset

C.Current

D.Reverse

A) A, B, C

B) B, C, D

C) A, B, D

D) A, C, D

Q2) A _______ is one way to implement a dictionary

A) hash table

B) linked list

C) stack

D) queue

Q3) Using the collection classes,___________.

A) programmers can code faster

B) programmers can expect excellent performance and maximum execution speed

C) the program uses memory efficiently

D) All of the above

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 relational database model is a way of organizing data and considering relationships based on the physical structure of the data.

A)True

B)False

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

A)True

B)False

Q3) Tables from databases are commonly shown in a GUI through a ________.

A) DataBoxView

B) DataGridView

C) ListBoxView

D) SpreadSheet

Q4) An object of a subclass of ________ is used to manage the data flow between your program and the database.

A)DataFlow

B)DatabaseContext

C)DbContext

D)EntityDataModel

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

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) When an async method encounters an await expression: If the asynchronous task has already completed,________.

A) the async method simply continues executing

B) the async method splits off another thread

C) the await method is called

D) the async method terminates

Q2) The async modifier indicates that a method or ________ expression contains at least one await expression.

A) attribute

B) lambda

C) property

D) iterator

Q3) Today's ________ computers,smartphones and tablets enable computers to perform tasks truly concurrently.

A) large memory

B) multiscreen

C) soft keyboard

D) multicore

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) Document authors can create a namespace prefix named xml.

A)True

B)False

Q2) When using a namespace,the prefix must always be included.

A)True

B)False

Q3) Method ________ adds a node,or collection of nodes,as children of the given node.

A) Add

B) XAdd

C) AddChildren

D) XAddChildren

Q4) XslCompiledTransform's Load method parses and loads a style sheet.

A)True

B)False

Q5) XDocument objects contain other nested XDocuments.

A)True

B)False

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) Layout of controls refers to the controls' _____.

A) size

B) event handlers

C) position

D) a and b

E) a and c

Q2) If a command is disabled,all methods of executing that command are disabled.

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.

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

Turn static files into dynamic content formats.

Create a flipbook