New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
programming with microsoft visual basic 2015
Programming With Microsoft Visual Basic 2012 6th Edition Diane Zak - Solutions
3. You can use a control to verify that a control on a Web page contains data.a. RequiredFieldValidatorb. RequiredFieldc. RequiredValidatord. none of the above
2. The Visual Basic code in a Web page is processed by the .a. client computerb. Web server
1. In code, you refer to a control on a Web page using the control’s property.a. Captionb. IDc. Named. Text
6. The text that appears on the application's tab in the browser window is determined by the property.a. Application object’s Nameb. Application object’s Titlec. Document object’s Tab Named. Document object’s Title
5. The HTML instructions in a Web page are processed by the .a. client computerb. Web server
4. The first Web page in an empty Web application is automatically assigned the name .a. Default.apsb. Default1.vbc. Default.aspxd. WebFormDefault.aspx
3. An online form used to purchase a product is an example of a Web page.a. dynamicb. static
2. A is a program that uses HTML to render a Web page on the computer screen.a. browserb. clientc. serverd. none of the above
1. A computer that requests an ASP page from a Web server is called a computer.a. browserb. clientc. requestingd. none of the above
4. The Salaried class is derived from a base class named Employee. Which of the following statements can be used by the Salaried class to invoke the Employee class’s default constructor?a. MyBase.New()b. MyEmployee.New()c. Call Employee.Newd. none of the above
3. A base class contains a method named GetTax. Which of the following procedure headers can be used in the derived class to indicate that it is providing its own code for the method?a. Public Inherits Sub GetTax()b. Public Overridable Sub GetTax()c. Public Overrides Sub GetTax()d. Public
2. A base class contains a method named GetTax. Which of the following procedure headers can be used in the base class to indicate that a derived class can provide its own code for the method?a. Public Inherits Sub GetTax()b. Public Overridable Sub GetTax()c. Public Overrides Sub GetTax()d. Public
1. Which of the following clauses allows a derived class named Cat to have the same attributes and behaviors as its base class, which is named Animal?a. Inherited Animalb. Inherits Animalc. Inherited Catd. Inherits Cat
4. Write the class definition for a class named Worker. The class should include Private variables and Property procedures for a Worker object’s name and salary. The salary may contain a decimal place. The class also should contain two constructors: the default constructor and a parameterized
3. Write the code for an auto-implemented property named Bonus. The property’s data type is Decimal.
2. Write the Property procedure for a ReadOnly property named TaxRate. The property is associated with the _decTaxRate variable.
1. What are overloaded methods and why are they used?
5. The Purchase class contains a ReadOnly property named Tax. The property is associated with the Private _dblTax variable. A button’s Click event procedure instantiates a Purchase object and assigns it to the currentSale variable. Which of the following is valid in the Click event procedure?a.
4. A ReadOnly property can be an auto-implemented property.a. Trueb. False
3. A class contains an auto-implemented property named Title. Which of the following is the correct way for the default constructor to assign the string “Unknown” to the variable associated with the property?a. _Title = "Unknown"b. _Title.strTitle = "Unknown"c. Title = "Unknown"d. none of the
2. The method name combined with the method’s optional parameterList is called the method’s .a. autographb. inscriptionc. signatured. statement
1. Two or more methods that have the same name but different parameterLists are referred to as methods.a. loadedb. overloadedc. paralleld. signature
4. Write a Class statement that defines a class named Tape. The class contains four Private String variables named _strName, _strArtist, _strSongNumber, and _strLength.Name the corresponding properties TapeName, Artist, SongNumber, and Length.Then, use the syntax shown in Version 2 in Figure 11-5
3. Rewrite the Class statement from Exercise 2 so that it uses Private variables rather than Public variables. Be sure to include the Property procedures and default constructor.
2. Write a Class statement that defines a class named Book. The class contains three Public variables named Title, Author, and Cost. The Title and Author variables are String variables. The Cost variable is a Decimal variable. Then use the syntax shown in Version 1 in Figure 11-5 to declare a
1. A class contains more than one constructor. Explain how the computer determines the appropriate constructor to use when instantiating an object.
13. A class contains a Private variable named _strState. The variable is associated with a Public property named State. Which of the following is the best way for a parameterized constructor to assign the value stored in its strName parameter to the variable?a. _strState = strNameb. State =
12. The Return statement is entered in the statement in a Property procedure.a. Getb. Set
11. If you need to validate a value before assigning it to a Private variable, you enter the validation code in the block in a Property procedure.a. Assignb. Getc. Setd. Validate
10. Which of the following instantiates an Item object and assigns it to the phone variable?a. Dim phone As Itemb. Dim phone As New Itemc. Dim phone As Item phone = New Itemd. both b and c
9. Which of the following is the name of the Item class’s default constructor?a. Itemb. ItemConstructorc. Defaultd. New
8. To hide a variable or method contained in a class, you declare the variable or method using the keyword .a. Hideb. Invisiblec. Privated. ReadOnly
7. An application can access the Private variables in a class .a. directlyb. using properties created by Public Property proceduresc. through Private procedures contained in the classd. none of the above
6. A Private variable in a class can be accessed directly by a Public method in the same class.a. Trueb. False
5. Which of the following statements is false?a. A class can contain only one constructor.b. An example of a behavior is the SetTime method in a Time class.c. An object created from a class is referred to as an instance of the class.d. An instance of a class is considered an object.
4. The Item class in Review Question 3 also contains a Public method named GetTax. The method is a Function procedure. Which of the following can be used by the application from Review Question 3 to invoke the GetTax method?a. dblNewCost = Call GetTaxb. dblNewCost = phone.GetTaxc. dblNewCost =
3. The Item class contains a Private variable named _dblCost. The variable is associated with the Public Cost property. An application instantiates an Item object and assigns it to a variable named phone. Which of the following can be used by the application to assign the number 150.65 to the
2. A constructor is .a. a Function procedureb. a Property procedurec. a Sub procedured. either a Function procedure or a Sub procedure
1. The name of a class file ends with .a. .clab. .clsc. .vbd. none of the above
5. The lstFriends control contains five items. Which of the following writes the last item to the file associated with the outFile variable?a. outFile.WriteLine(lstFriends.Items(5))b. outFile.WriteLine(lstFriends.Items(4))c. outFile.WriteLine(lstFriends.Index(4))d. none of the above
4. Which of the following determines whether an item is selected in the lstFriends control?a. If lstFriends.SelectedIndex >= 0 Thenb. If lstFriends.SelectedItem –1 Thenc. If lstFriends.IndexSelected = –1 Thend. none of the above
3. Which of the following removes the fourth item from the lstFriends control?a. lstFriends.Items.Remove(4)b. lstFriends.Items.RemoveAt(4)c. lstFriends.Items.RemoveIndex(3)d. none of the above
2. Which of the following right-aligns the contents of the strNumbers variable?a. strNumbers = strNumbers.PadLeft(10)b. strNumbers = strNumbers.PadRight(10)c. strNumbers = strNumbers.AlignLeft(10)d. strNumbers = strNumbers.RightAlign(10)
1. Which of the following opens a sequential access file named “MyFriends.txt” for input?a. inFile = IO.File.Input("MyFriends.txt")b. inFile = IO.InputFile("MyFriends.txt")c. inFile = IO.File.InputText("MyFriends.txt")d. inFile = IO.File.OpenText("MyFriends.txt")
5. Write a Do clause that determines whether the end of a sequential access file has been reached. The file is associated with a StreamReader variable named inFile.
4. Write an If clause that determines whether a sequential access file exists. The file’s name is sales.txt.
3. Write the code to close the sequential access file associated with a StreamWriter variable named outFile.
2. Write the code to declare a variable named inFile that can be used to read data from a sequential access file. Then write the statement to open a sequential access file named sales.txt for input.
1. Write the code to declare a variable named outFile that can be used to write data to a sequential access file. Then write the statement to open a sequential access file named sales.txt for output.
7. The AppendText method creates a object.a. Fileb. SequenceReaderc. StreamWriterd. none of the above
6. The OpenText method creates a object.a. Fileb. SequenceReaderc. StreamWriterd. none of the above
5. Which of the following can be used to determine whether the employ.txt file exists?a. If IO.File.Exists("employ.txt") Thenb. If IO.File("employ.txt").Exists Thenc. If IO.Exists("employ.txt") = True Thend. If IO.Exists.File("employ.txt") = True Then
4. The Peek method returns when the end of the file is reached.a. –1b. 0c. the last character in the filed. the newline character
3. Which of the following reads a line of text from a sequential access file and assigns the line (excluding the newline character) to the strText variable?a. inFile.Read(strText)b. inFile.ReadLine(strText)c. strText = inFile.ReadLined. strText = inFile.Read(line)
2. If the file to be opened exists, the method erases the file’s contents.a. AppendTextb. CreateTextc. InsertTextd. OpenText
1. Which of the following opens the employ.txt file and allows the computer to write new data to the end of the file’s existing data?a. outFile = IO.File.AddText("employ.txt")b. outFile = IO.File.AppendText("employ.txt")c. outFile = IO.File.InsertText("employ.txt")d. outFile =
6. An application contains the Structure statement shown here. Write a Dim statement that declares a five-element one-dimensional array of MyFriend variables. Name the array home. Then, write an assignment statement that assigns the value in the txtName control to the strName member contained in
5. An application contains the Structure statement shown here. Write a Private statement that declares a 10-element one-dimensional array of Computer variables. Name the array business. Then, write an assignment statement that assigns the string “HPP405”to the strModel member contained in the
4. An application contains the Structure statement shown here. Write a Dim statement that declares a MyFriend variable named school. Then, write assignment statements that assign the value in the txtFirst control to the strFirst member and assign the value in the txtLast control to the strLast
3. An application contains the Structure statement shown here. Write a Dim statement that declares a Computer variable named homeUse. Then, write an assignment statement that assigns the string “IB-50” to the strModel member. Finally, write an assignment statement that assigns the number 2400
2. Write a Structure statement that defines a structure named Tape. The structure contains four member variables named strName, strArtist, strSongLength, and intSongNum. Then write a Private statement that declares a Tape variable named blues.
1. Write a Structure statement that defines a structure named Book. The structure contains three member variables named strTitle, strAuthor, and decPrice. Then write a Dim statement that declares a Book variable named fiction.
5. In most applications, the Structure statement is entered in the form’s .a. Declarations sectionb. Definition sectionc. Load event procedured. User-defined section
4. An application uses a structure named Employee. Which of the following statements declares a five-element array of Employee structure variables?a. Dim workers(4) As Employeeb. Dim workers(5) As Employeec. Dim workers As Employee(4)d. Dim workers As Employee(5)
3. An array is declared using the statement Dim onOrder(10) As Items. Which of the following statements assigns the number 50 to the intQuantity member variable contained in the last array element?a. onOrder.intQuantity(10) = 50b. Items.onOrder.intQuantity = 50c. onOrder(9).intQuantity = 50d.
2. A structure variable named course contains a member variable named strNum. Which of the following statements assigns the string “CIS250” to the member variable?a. course.strNum = "CIS250"b. course&strNum = "CIS250"c. strNum.course = "CIS250"d. none of the above
1. Which statement is used to create a user-defined data type?a. Declareb. Definec. Structured. UserType
7. Write the statement that determines the number of elements in a two-dimensional array named strTypes. The statement should assign the number to the intNumTypes variable.
6. Write the statements that determine the highest row and highest column subscripts in a two-dimensional array named strTypes. The statements should assign the subscripts to the intHighRow and intHighCol variables, respectively.
5. Write the Private statement to declare a two-dimensional Integer array named intOrders that has three rows and two columns. Use the following values to initialize the array: 1, 2, 10, 20, 100, 200.
4. Write the statement to assign the Boolean value True to the variable located in the third row, first column of a two-dimensional Boolean array named blnAnswers.
3. Rewrite the code from Exercise 2 using a Do…Loop statement.Data from in exercise 22. Write a loop to store the number 10 in each element in the intBalances array from Exercise 1. Use the For…Next statement.Data from in exercise 11. Write the statement to declare a procedure-level
2. Write a loop to store the number 10 in each element in the intBalances array from Exercise 1. Use the For…Next statement.Data from in exercise 1 1. Write the statement to declare a procedure-level two-dimensional array named intBalances. The array should have four rows and six columns. Then
1. Write the statement to declare a procedure-level two-dimensional array named intBalances. The array should have four rows and six columns. Then write the statement to store the number 100 in the element located in the second row, fourth column.
7. Which of the following returns the highest column subscript in a two-dimensional array named decPays?a. decPays.GetUpperBound(1)b. decPays.GetUpperBound(0)c. decPays.GetUpperSubscript(0)d. decPays.GetHighestColumn(0)
6. Which of the following assigns the number 0 to each element in a two-row, four-column Integer array named intSums?a. For intRow As Integer = 0 To 1 For intCol As Integer = 0 To 3 intSums(intRow, intCol) = 0 Next intCol Next intRowb. Dim intRow As Integer Dim intCol As Integer Do While intRow < 2
5. Which of the following statements assigns the string “California” to the element located in the third column, fifth row in the two-dimensional strStates array?a. strStates(3, 5) = "California"b. strStates(5, 3) = "California"c. strStates(4, 2) = "California"d. strStates(2, 4) = "California"
4. The intSales array is declared as follows: Dim intSales(,) As Integer = {{1000, 1200, 900, 500, 2000}, {350, 600, 700, 800, 100}}. Which of the following If clauses determines whether the intRow and intCol variables contain valid row and column subscripts, respectively, for the array?a. If
3. The intSales array is declared as follows: Dim intSales(,) As Integer = {{1000, 1200, 900, 500, 2000}, {350, 600, 700, 800, 100}}. The intSales(0, 4) =intSales(0, 4 - 2) statement will .a. replace the 500 amount with 1200b. replace the 2000 amount with 900c. replace the 2000 amount with 1998d.
2. The intSales array is declared as follows: Dim intSales(,) As Integer = {{1000, 1200, 900, 500, 2000}, {350, 600, 700, 800, 100}}. The intSales(1, 3) =intSales(1, 3) + 10 statement will .a. replace the 900 amount with 910b. replace the 500 amount with 510c. replace the 700 amount with 710d.
1. Which of the following declares a two-dimensional array that has three rows and four columns?a. Dim decNums(2, 3) As Decimalb. Dim decNums(3, 4) As Decimalc. Dim decNums(3, 2) As Decimald. Dim decNums(4, 3) As Decimal
4. The dblNums array is a six-element Double array. Which of the following If clauses determines whether the entire array has been searched?a. If intSub = dblNums.Length Thenb. If intSub dblNums.GetUpperBound(0) Thend. both a and c
3. The strStates and strCapitals arrays are parallel arrays. If Illinois is stored in the second element in the strStates array, where is its capital (Springfield) stored?a. strCapitals(1)b. strCapitals(2)
2. If the elements in two arrays are related by their subscripts, the arrays are called arrays.a. associatedb. coupledc. matchingd. parallel
1. The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following If clauses determines whether the intSub variable contains a valid subscript for the array?a. If intSub >= 0 AndAlso intSub = 0 AndAlso intSub < 4 Thenc. If intSub >= 0
Open the Scores Solution (Scores Solution.sln) file contained in the VB2012\Chap09\Scores Solution folder. If necessary, open the designer window. Open the Code Editor window and then open the code template for the btnDisplay control’s Click event procedure. Declare a 20-element, one-dimensional
In this exercise, you modify the application from Exercise 16. The modified application allows the user to display the number of students earning a score within a specific range.Use Windows to make a copy of the Scores Solution folder. Rename the folder Modified Scores Solution. Open the Scores
11. Write the code to add together the numbers stored in the first and second elements in a one-dimensional array named intNumbers. Display the sum in the lblSum control.
10. Write the code to multiply by 3 the number stored in the first element in a onedimensional array named intNumbers. Store the result in the intResult variable.
3. Write the statement to declare and initialize a procedure-level one-dimensional array named dblRates. Use the following numbers to initialize the array: 5.6, 7.5, and 3.4.
2. Write the statement to declare a class-level one-dimensional array named strFurniture. The array should be able to store 5 strings. Then write the statement to store the string “Chair” in the third element.
1. Write the statement to declare a procedure-level one-dimensional array named intQuantities. The array should be able to store 15 integers. Then write the statement to store the number 10 in the second element.
Which of the following statements assigns the strNames array’s highest subscript to the intLastSub variable?a. intLastSub = strNames.Lengthb. intLastSub = strNames.GetUpperBound(0) - 1c. intLastSub = strNames.GetUpperBound(0)d. both a and b
The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}.Which of the following blocks of code correctly calculates the average value stored in the array? The intTotal, intSub, and dblAvg variables contain the number 0 before the loop is processed.a. For Each intX As
13. Which of the following assigns the number 1 to each element in a five-element, one-dimensional Integer array named intCounters?a. For intSub As Integer = 0 To 4 intCounters(intSub) = 1 Next intSubb. Dim intSub As Integer Do While intSub < 5 intCounters(intSub) = 1 intSub += 1 Loopc. For intSub
12. Which of the following assigns the string “Rover” to the fifth element in a one-dimensional array named strPetNames?a. strPetNames(4) = "Rover"b. strPetNames[4] = "Rover"c. strPetNames(5) = "Rover"d. strPetNames.Items.Add(5) = "Rover"
11. Which of the following statements assigns (to the intElements variable) the number of elements contained in the intNums array?a. intElements = Len(intNums)b. intElements = Length(intNums)c. intElements = intNums.Lend. intElements = intNums.Length
10. Which of the following statements sorts the intQuantities array in ascending order?a. Array.Sort(intQuantities)b. intQuantities.Sortc. Sort(intQuantities)d. SortArray(intQuantities)
9. What will the code in Review Question 5’s answer d assign to the dblAvg variable?a. 0b. 5c. 6d. 8
8. What will the code in Review Question 5’s answer c assign to the dblAvg variable?a. 0b. 5c. 6d. 8
Showing 800 - 900
of 1847
First
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Last
Step by Step Answers