Skip to main content

Computer Science II Test Questions - 1124 Verified Questions

Page 1


Computer Science II

Test Questions

Course Introduction

Computer Science II is a continuation of foundational programming concepts, emphasizing object-oriented design, data structures, and algorithm analysis. Students will deepen their understanding of programming languages and learn techniques for managing complexity in larger software projects, such as encapsulation, inheritance, and polymorphism. The course covers essential data structures including arrays, linked lists, stacks, queues, trees, and hash tables, alongside sorting and searching algorithms. Through hands-on projects and assignments, students will develop skills in designing, implementing, testing, and debugging robust programs, preparing them for more advanced computer science courses.

Recommended Textbook

C# Programming From Problem Analysis to Program Design 4th Edition by Barbara Doyle

Available Study Resources on Quizplus

15 Chapters

1124 Verified Questions

1124 Flashcards

Source URL: https://quizplus.com/study-set/492 Page 2

Chapter 1: Introduction to Computing and Programming

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Which of the following statements would produce the output shown here? Live Life to the fullest

A) Console.WriteLine("Live\nLife to the \tfullest");

B) Console.WriteLine("Live Life to the fullest");

C) Console.WriteLine("Live Life to the fullest");

D) Console.WriteLine("Live\\nLife to the \\tfullest");

Answer: A

Q2) Programmers commonly verify that their design is correct by doing a(n)_____________.

Answer: desk check

Q3) When you use the ____________ approach to solving a problem,you break the problem into subtasks.

Answer: divide and conquer

Q4) The method ________ is the entry point for all applications.This is where the program begins execution.

Answer: Main( )

Q5) A(n)____________ is a mock-up of screens depicting the look of the final output.

Answer: prototype

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

Chapter 2: Data Types and Expressions

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Which statement subtracts 100 from the original value of an answer?

A) 100 -= answer;

B) answer = 100 -;

C) answer =- 100;

D) answer -= 100;

Answer: D

Q2) Another way to write the following expression is ____. ans *= v1 - 1;

A) ans = v1 * ans - 1;

B) ans = v1 * (ans - 1);

C) ans = ans * v1--;

D) ans = ans * --v1;

Answer: D

Q3) An appropriate identifier used to store the total transaction amount is total$Amount. A)True

B)False

Answer: False

Q4) ____________ is the universal character-encoding schema that provides a unique number for every character in many different languages. Answer: Unicode

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

Chapter 3: Methods and Behaviors

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) A method that does not return any value on exit,____. A) must be called with the void keyword

B) cannot include the return keyword C) must be defined to have a void return type D) is not allowed in C#

Answer: C

Q2) In order to hold the screen when the program runs,programmers often add Console.Read( )as a last statement.

A)True

B)False

Answer: True

Q3) The following are examples of the access modifiers available in C#: public,personal,protected.

A)True

B)False

Answer: False

Q4) The Write( ),WriteLine( ),Read( ),and ReadLine( )methods are all overloaded.

A)True

B)False Answer: False

Page 5

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

Chapter 4: Creating Your Own Classes

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) The ToString( )method is automatically invoked when the Write( )or WriteLine( )methods are called.

A)True

B)False

Q2) The return type for constructors is always the type of the class.

A)True

B)False

Q3) Instance methods manipulate data by ____.

A) directly accessing private data members.

B) passing information as arguments through parameters.

C) using constructors and accessors.

D) sending visible data in the Main( ) method.

Q4) What will be displayed from the above line?

A) Value = 12,346

B) Value = 12346

C) Value = 12,345

D) Value = 12,346.0

Q5) As with overloaded methods,____________ must differ for constructors.

Q6) The body of the constructor methods consist primarily of ____________.

Q7) Accessor and mutators are ____________ methods

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

Chapter 5: Making Decisions

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) The logical operators in C# are ____.

A) >, <, >=, <=

B) && and ||

C) != and ==

D) ==, =, and !=

Q2) Which of the following statements is NOT true regarding switch statements?

A) The expression is sometimes called the selector.

B) Default is only executed when there is no match.

C) Default is required.

D) A variable cannot be used as the case label.

Q3) Iteration,also called selection is used for decision making and allows your program statements to deviate from the sequential path and perform different statements based on the value of an expression.

A)True

B)False

Q4) Boolean variables store 0 to represent off or false and 1 to represent on or true.

A)True

B)False

Q5) The switch statement also goes by the name ____________.

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

Chapter 6: Repeating Instructions

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Which of the following is NOT a keyword used to enable unconditional transfer of control to a different program statement?

A) continue

B) break

C) goto

D) while

Q2) A(n)____________ is a loop that has no provisions for termination.

Q3) How many times will be loop body be executed?

A) 0

B) 4

C) 5

D) 6

Q4) Windows applications use an event-driven model to manage the interaction between the user and the GUI by handling the repetition for you.

A)True

B)False

Q5) The _____________ method of the MessageBox class displays a predefined dialog box that can contain text,captions for the title bar,special buttons,and icons.

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

Chapter 7: Arrays

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Given an array declared to hold 100 values,the smallest index that can be used with the array is ____.

A) based on what index is used when the first value is placed in the array

B) 1

C) 0

D) undetermined

Q2) Arrays are reference variables.

A)True

B)False

Q3) The Copy( )method,shown above,is a(n)____________ method.

Q4) In C# the length of an array cannot be changed.After it is instantiated with a length,dynamic resizing is not an option.

A)True

B)False

Q5) When you pass an array to a method,by default,a copy of each element in the array is made and passed to the method.

A)True

B)False

Q6) All data values placed in an array must be of the same ____________.

Page 9

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

Chapter 8: Advanced Collections

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Using the code shown above,what is added to total during the first iteration?

A) 0

B) 88

C) 86, 66, 76, 92 and 95

D) unknown, because val is not initialized

Q2) In C#,the string type allows individual characters to be accessed using a(n)____________ with the [ ].

Q3) The ArrayList class can be used to create a listlike structure that can dynamically increase or decrease in length.

A)True

B)False

Q4) ____ are types of data structures that consist of a sequence of data records such that in each record there is an additional field that contains a reference (i.e.,a link)to the next record in the sequence.

A) Arrays

B) ArrayLists

C) Linked lists

D) Strings

Q5) The property ____________ returns the number of dimensions of the array.

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

Chapter 9: Introduction to Windows Programming

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) The ____________ options enable you to increase or decrease the amount of blank space displayed between objects.

Q2) In order to change the background color for the application,you could set the BackColor property of the form.

A)True

B)False

Q3) Double-clicking on the form when you are using the Form Designer brings up the Code Editor and also ____.

A) creates a syntax error

B) registers a double click event

C) runs the application

D) adds a form load method heading

Q4) ____________ objects are normally used to provide descriptive text for another control.

Q5) A console-based application interface can include menus,buttons,pictures,and text in many different colors and sizes.

A)True

B)False

Q6) When a button is clicked by a user,its ____________ is automatically called up.

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

Chapter 10: Programming Based on Events

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) In order for event handlers to be called using delegates,the delegate must ____.

A) be declared with a return type of void

B) include at least two parameter arguments representing the event and object

C) be instantiated in the application as a delegate

D) maintain a list of the registered event handlers for the event

Q2) To add functionality to a control such as a Button or ListBox,you need to ____________ for it.

Q3) Delegates are special types of .NET classes whose instances store ____.

A) references to actual data.

B) data

C) references to methods

D) methods

Q4) Use the Format>Align menu options to line up associated controls so controls are consistently placed in the same row or column.

A)True

B)False

Q5) A number of objects can be wired to the same event-handler method.

A)True

B)False

Q6) The ____________ event fires when a key is pressed while the control has focus.

Page 12

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

Chapter 11: Advanced Object-Oriented Programming

Features

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) With C#,you have single inheritance,but a class can ____________ multiple interfaces.

Q2) An overloaded method must have exactly the same signature as the method it is overriding.

A)True

B)False

Q3) In order to inherit from a user-defined base class,you must ____.

A) store both files in the same directory

B) add the base class following a colon

C) add a reference to the base class

D) store both files using the same extension

Q4) Components are implemented in C# through ____.

A) classes

B) encapsulation

C) namespaces

D) packages

Q5) When a class implements an interface,the body of each of the interface's methods has to be written in the new class.

A)True

B)False

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

Chapter 12: Debugging and Handling Exceptions

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) A(n)____________ error is associated with a language rule violation.

Q2) Markers placed in an application to indicate the program should halt execution when it reaches that spot is a ____.

A) breakpoint

B) break mode

C) debug point

D) debugger spot

Q3) The code that you want executed,whether an exception is thrown or not,is placed in the ____ block.

A) try

B) catch

C) finally

D) if

Q4) What order should ArithmeticException,DivideByZeroException,and Exception catch clauses be placed in a try...catch block?

A) ArithmeticException, DivideByZeroException, Exception

B) Exception, ArithmeticException, DivideByZeroException

C) DivideByZeroException, ArithmeticException, Exception

D) Exception, ArithmeticException, DivideByZeroException,

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

Chapter 13: Working with Files

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) The constructor for the StreamWriter class is overloaded to include a Boolean variable indicating whether this is the first time the file was accessed.

A)True

B)False

Q2) The ____ class has implementations for Write( )and WriteLine( )methods similar to the Console class methods.

A) StreamWriter

B) Writer

C) TextWriter

D) FileWriter

Q3) None of the of the method named in the File and Directory classes are available as instance methods (with the same name)in the FileInfo and DirectoryInfo classes since they are available in File and Directory.

A)True

B)False

Q4) To ensure that the data is usable for the next application the ____________ method should be invoked before you exit the application.

Q5) Archive is a(n)____________ value for the Attributes property of the File class.

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

Chapter 14: Working with Databases

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) A foreign key is a column (field)or combination of columns that uniquely identifies a row in a table.

A)True

B)False

Q2) When finished processing the data,you should close the reader and connection objects.Doing so ____.

A) creates a log of the database activities

B) positions the reader back to the beginning row

C) unlocks the database so that other applications can access it

D) flushes the buffer and gets it ready for the next read

Q3) A cache of records retrieved from some data source that may contain one or more tables from the data source describes a(n)____.

A) database

B) dataset

C) data adapter

D) data reader

Q4) The ____________ provides a visual representation of the dataset and table adapter.It can be used to create and modify data and table adapters and their queries.

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

Page 16

Chapter 15: Web-Based Applications

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

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

Sample Questions

Q1) Dynamic Web pages normally involve some processing in addition to rendering the formatting of HTML tags.

A)True

B)False

Q2) All of the following are true regarding Cascading Style Sheets (CSS)EXCEPT ____.

A) CSS uses style sheets to describe how elements will look in terms of their layout

B) CSS lets you separate the actual content from how it is going to look

C) CSS enables you to provide more consistency across pages on Web sites

D) CSS stores tags representing sizes, colors of fonts, and alignment of text within the HTML markup

Q3) Which validation control compares an input value to see if it is between a specified lower and upper boundary?

A) RegularExpressionValidator

B) BoundaryValidator

C) CompareValidator

D) RangeValidator

Q4) HTML controls do not maintain state..

A)True

B)False

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

Turn static files into dynamic content formats.

Create a flipbook
Computer Science II Test Questions - 1124 Verified Questions by Quizplus - Issuu