Introduction to Windows Programming Midterm Exam - 822 Verified Questions

Page 1


Introduction to Windows Programming

Midterm Exam

Course Introduction

Introduction to Windows Programming provides students with a foundational understanding of building applications for the Microsoft Windows operating system. The course covers essential concepts such as the Windows API, event-driven programming, window management, and graphical user interface (GUI) development. Students will learn how to create, manage, and optimize Windows applications using development tools and programming languages like C++ or C#. By the end of the course, students will have the practical skills to design interactive and user-friendly Windows applications, gaining insight into best practices and industry standards in Windows programming.

Recommended Textbook

Programming with Microsoft Visual Basic 2017 8th Edition by Diane Zak

Available Study Resources on Quizplus

14 Chapters

822 Verified Questions

822 Flashcards

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

Page 2

Chapter 1: An Introduction to Visual Basic 2015

Available Study Resources on Quizplus for this Chatper

44 Verified Questions

44 Flashcards

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

Sample Questions

Q1) A(n)____ is a predefined procedure that you can call (or invoke)when needed.

A)method

B)object

C)class

D)event

Answer: A

Q2) When you click the Auto Hide button on a window,the window is minimized and appears as a tab on the edge of the IDE.

A)True

B)False Answer: True

Q3) The Windows ____ window allows you to create the graphical user interface for your application.

A)Property

B)Solution Designer

C)Designer

D)Form Designer

Answer: D

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

3

Chapter 2: Designing Applications

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) The symbol used in code for assignment is the ____ symbol.

A)

B)^

C)<

D)= Answer: D

Q2) The following statement should subtract the contents of the txtEndInventory control from the contents of the txtBeginInventory control,and then divide the difference by 2: Val(txtEndInventory)- Val(txtBeginInventory)\ 2

Answer: Val(txtBeginInventory.Text)- Val(txtEndInventory.Text)/ 2

Q3) The Windows standard is to use sentence capitalization for identifying labels.

A)True

B)False Answer: True

Q4) The first step in the planning phase of a programming solution is to sketch the user interface.

A)True

B)False Answer: False

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

Chapter 3: Using Variables and Constants

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) The strFirstName and strLastName variables contain the strings "Jane" and "Jones",respectively.Which of the following statements will display a string as "Jones,Jane" (the last name,a comma,a space,and the first name)in the lblFullName control?

A)lblFullName = strLastName, & strFirstName

B)lblFullName = strLastName & ", " strFirstName

C)lblFullName = strLastName & ", " & strFirstName

D)none of the above Answer: C

Q2) You use the ____ operator to concatenate strings together. A)@

B)%

C)&

D)# Answer: C

Q3) The decRate variable contains the number .03.Write the assignment statement to display the value as 3% in the lblRate control. Answer: lblRate.Text = decRate.ToString("P0")

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

Chapter 4: The Selection Structure

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Consider the expression 3 * 2 ^ 2 < 16 + 5 AndAlso 100 / 10 * 2 > 15 - 3.Which operation is performed last?

A)^

B)<

C)>

D)AndAlso

Q2) The ____ operator expresses "not equal to."

A)>

B)<>

C)>=

D)<=

Q3) What is a selection structure? What is the difference between a single-alternative and dual-alternative selection structure?

Q4) Before using a string in a comparison,you can use either the ToUpper method or the ToLower method to convert the string to uppercase or lowercase,respectively,and then use the converted string in the comparison.

A)True

B)False

Q5) What is a group box and how is it used?

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

Chapter 5: More on the Selection Structure

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

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

Sample Questions

Q1) Write a multiple-alternative selection structure that displays the name of an instructor based on the class section entered by the user.The class section is stored (as uppercase)in the strSection variable.Display "Edwards" when the class section is A.Display "Hughes" when the class section is B.Display "Meadows" when the class section is C.For all other sections,display "To Be Announced".Display the message in the lblMessage control.Use the Select Case statement.

Q2) Which of the following conditions will evaluate to True when the chkValidID check box is not selected?

A)If chkValidID.check = False Then

B)If chkValidID.check = No Then

C)If chkValidID.checked = No Then

D)If chkValidID.checked = False Then

Q3) A common error made when writing selection structures is to use a compound condition in the outer selection structure when a nested selection structure is needed.

A)True

B)False

Q4) What is a nested selection structure? How do primary and secondary decisions relate to a nested selection structure?

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

Chapter 6: The Repetition Structure

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) How many times will the message display based on the counter being initialized to 0? intCounter = 0

Do While intCounter < 5 MessageBox.Show("OK")

IntCounter = intCounter + 1

Loop

A)zero

B)one

C)four

D)five

Q2) What is a counter-controlled loop and when is it used in a program? What statement provides the most efficient way to write a counter-controlled loop?

Q3) The startValue in a For...Next loop structure may be omitted. A)True B)False

Q4) Write a pretest loop that adds together the integers 2,4,6,8,10,12,14,16,18,and 20.Use the intNum variable to keep track of the integers.Store the result in the intResult variable (which contains the number 0).Use the For...Next statement.

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

Chapter 7: Sub and Function Procedures

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) The computer automatically processes an event procedure when the event occurs.

A)True

B)False

Q2) The syntax of the Call statement is ____.

A)Call procedureName([argumentList])

B)Call procedureName{[parameterList]}

C)Call procedureName([argumentList], dataType)

D)Call procedureName([argumentList]) As dataType

Q3) When you pass a variable ____,the computer passes only the contents of the variable to the receiving procedure.

A)by reference

B)by parameter

C)by dataType

D)by value

Q4) The names of the arguments in a Call statement need to be identical to the names of the corresponding parameters.

A)True

B)False

Q5) What is a combo box? List the three styles of combo boxes available in Visual Basic.

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

Chapter 8: String Manipulation

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Neither the Trim method nor the Remove method removes any characters from the original string.

A)True

B)False

Q2) If a menu item requires additional information from the user,the Windows standard is to place a(n)____ at the end of the caption.

A)underscore (_)

B)asterisk (*)

C)pound key (#)

D)ellipsis ( )

Q3) You can use a string's Value property to determine the number of characters it stores.

A)True

B)False

Q4) The strSerialNum variable contains the string "DRY259614".Write the Visual Basic statement that assigns the string "259614" from the strSerialNum variable to the strProductCode variable.

Q5) Describe four of the six menu standards that should be followed when including a menu in an application.

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

Chapter 9: Arrays

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Based on the code below,intScores(0,0)is initialized to ____.

Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}

A)9

B)25

C)75

D)90

Q2) Before you can use an array,you first must declare it.

A)True

B)False

Q3) Explain the difference between a simple variable and an array.

Q4) The syntax ____ assigns either the value entered in the txtSales control (converted to Decimal)or the number 0 to the third element in the decSales array.

A)Decimal.TryParse(txtSales.Text, decSales(3))

B)Decimal.TryParse(txtSales.Text, decSales(0))

C)Decimal.TryParse(txtSales.Text, decSales(2))

D)TryParse(txtSales.Text, decSales(1))

Q5) Write the statement to declare a six-element class-level array named strAnimal,and initialize the array with the following values: dog,cat,mouse,bird,snake,fish.

Q6) Describe two advantages to using arrays to store data.

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

Chapter 10: Structures and Sequential Access Files

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) What is the difference between an input file and an output file?

Q2) A file to which information is written is referred to as a(n)____ file.

A)report

B)text

C)output

D)data

Q3) You can use the ____ to open a sequential access file for append.

A)CreateText method

B)StreamReader object

C)StreamWriter object

D)AppendText method

Q4) Which of the following removes the sixth item from the lstTrees control?

A)lstTrees.Items.Remove(5)

B)lstTrees.Items.Remove(6)

C)lstTrees.Items.RemoveAt(5)

D)lstTrees.Items.RemoveAt(6)

Q5) Describe two advantages to programmers of using structures and structure variables.

Q6) Write the statement that would remove the selected item from the lstFlowers control if an item is selected.

Page 12

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

Chapter 11: Classes and Objects

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Private variables represent properties that will be seen by anyone using an object created from the class.

A)True

B)False

Q2) Write a Class statement that defines a class named Employee.(The class contains four public variables named EmpID,LastName,FirstName,and PayRate.The EmpID,LastName,and FirstName variables are String variables.The PayRate variable is a Decimal variable.)Then write a statement that creates an Employee variable named partTime and also instantiates an Employee object,assigning it to the partTime variable.

Q3) The code in the ____ allows an application to assign a value to the Private variable associated with the property.

A)Get block

B)default constructor

C)Set block

D)Property procedure

Q4) In its simplest form,the Class statement can be used in place of the Structure statement.

A)True

B)False

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

Chapter 12: Web Applications

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Write the If statement that determines whether the first radio button in the rblOptions control is selected.

Q2) The purpose of the ____ tool is to verify that a control contains data.

A)CompareValidator

B)RegularExpressionValidator

C)RequiredFieldValidator

D)RangeValidator

Q3) One drawback of dynamic Web pages is that they are not interactive.

A)True

B)False

Q4) List the six validator tools available in the Validation section of the toolbox that are used for validating user input.

Q5) When a user clicks a button on the Web page,the page and data are submitted to the server for processing.This event is referred to as a ____.

A)refresh

B)postback

C)recall

D)post

Q6) Write the statement that determines whether the chkDiscount control is selected?

Page 14

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

Chapter 13: Working With Access Databases and Linq

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Write the statements to move the record pointer to the previous and next records in the dataset for the Vehicle table.

Q2) Write a LINQ statement to select the records in descending order by the Quantity field.

Q3) Write a LINQ statement to select all records.

Q4) The ____ statement is used for exception handling in a procedure.

A)Try...Catch

B)LINQ

C)Order By

D)aggregate

Q5) The computer can retrieve data stored in a relational format both quickly and easily,but the data must be displayed in a specific order.

A)True

B)False

Q6) The controls connected to an object in a dataset are known as ____.

A)bound controls

B)navigator controls

C)tables

D)fields

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

Chapter 14: Access Databases and SQL

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Which of the following sorts the records for the PartsDataSet by the Price field?

A)TblPartsDataSet.Sort = "Price"

B)TblPartsBindingSource.Sort = "Price"

C)TblPartsBindingSource.Sort = Price

D)TblPartsTableAdapter.Sort = "Price"

Q2) For the changes made to a dataset to be permanent,you need to save the changes to the database associated with the dataset.

A)True

B)False

Q3) A Try Catch statement ends with ____.

A)End

B)End Try Catch

C)End Catch

D)End Try

Q4) What method could be used to invoke the previous query during run time?

A)FillByPrice

B)SELECT

C)WHERE

D)Fill

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

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.