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 2015 7th Edition Diane Zak - Solutions
In this exercise, you modify the Norbert Pool & Spa Depot application from this lesson. Use Windows to make a copy of the Norbert Solution folder. Rename the copy Norbert Solution-Introductory. Open the Norbert Solution (Norbert Solution.sln) file contained in the Norbert Solution-Introductory
Which of the following is the name of the Inventory class’s default constructor?a. Inventoryb. InventoryConstructorc. Defaultd. New
Open the Hire Date Solution (Hire Date Solution.sln) file contained in the VB2015\ Chap11\Hire Date Solution folder. First, add a default constructor and a parameterized constructor to the FormattedDate class. Also, add a method that returns the month and day numbers separated by a slash (/). Next,
In this exercise, you modify the Pete’s Pizzeria application from this lesson. Use Windows to make a copy of the Pizzeria Solution folder. Rename the copy Pizzeria Solution-Parameterized. Open the Pizzeria Solution (Pizzeria Solution.sln) file contained in the Pizzeria Solution-Parameterized
To hide a variable or method contained in a class, you declare the variable or method using the ___________________ keyword.a. Hideb. Invisiblec. Privated. ReadOnly
In this exercise, you modify the Norbert Pool & Spa Depot application from Lesson A. Use Windows to make a copy of the Norbert Solution folder. Rename the copy Norbert Solution-Auto. Open the Norbert Solution (Norbert Solution.sln) file contained in the Norbert Solution-Auto folder. Modify the
An application contains the statement Dim myCar As Car. Using the Car class from Figure 11-28, write an assignment statement that instantiates a Car object and initializes it using the strType and dblPrice variables. The statement should assign the object to the myCar variable. Public Class Car
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
Add a method named GetNewSalary to the Worker class from Exercise 5. The method should calculate a Worker object’s new salary, which is based on a raise percentage provided by the application using the object. Before calculating the new salary, the method should verify that the raise percentage
Using the Car class from Figure 11-28, write a Dim statement that uses the parameterized constructor to instantiate a Car object. Pass the string “Fusion” and the number 22560.99 to the parameterized constructor. The Dim statement should assign the object to a variable named rentalCar. Public
A Private variable in a class can be accessed directly by a Public method in the same class.a. Trueb. False
Rewrite the code from Exercise 4 using auto-implemented properties.Data From Exercise 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
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.
The Car class definition is shown in Figure 11-28. Write a Dim statement that uses the default constructor to instantiate a Car object in an application. The Dim statement should assign the object to a variable named nissan. Next, write assignment statements that the application can use to assign
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.
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
A WriteOnly property can be an auto-implemented property.a. Trueb. False
Write a Class statement that defines a class named SongInfo. The class contains three Private String variables named _strName, _strArtist, and _strSongLength. Name the corresponding properties SongName, Artist, and SongLength. Then, use the syntax shown in Version 2 in Figure 11-5 to create a Song
The Item class contains a Public method named GetDiscount. The method is a Function procedure. An application instantiates an Item object and assigns it to a variable named cellPhone. Which of the following can be used by the application to invoke the GetDiscount method?a. dblDiscount = Call
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
Write the code for an auto-implemented property named Commission. The property’s data type is Decimal.
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 above
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.Data From Exercise 2:Write a Class statement that defines a class named Book. The class contains three Public variables:
The Inventory class contains a Private variable named _strId. The variable is associated with the Public ItemId property. An application instantiates an Inventory object and assigns it to a variable named onHand. Which of the following can be used by the application to assign the string “XG45”
Open the VB2015\Chap11\Debug Solution\Debug Solution (Debug Solution.sln) file. Open the Code Editor windows for the form and the class file. Review the existing code. Correct the code to remove the jagged lines in the Shape and Circle class definitions. Save the solution, and then start and test
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 Overriding
Write the Property procedure for a ReadOnly property named Sales, which is associated with the _dblSales variable.
The method name combined with the method’s optional parameterList is called the method’s ___________________.a. Autographb. Inscriptionc. Signatured. Statement
Write a Class statement that defines a class named Book. The class contains three Public variables: Title, Author, and Price. The Title and Author variables are String variables. The Price variable is a Decimal variable. Then use the syntax shown in Version 1 in Figure 11-5 to declare a variable
A constructor is ___________________.a. A Function procedureb. A Property procedurec. A Sub procedured. Either a Function procedure or a Sub procedure
Open the Kerry Sales Solution (Kerry Sales Solution.sln) file contained in the VB2015\ Chap11\Kerry Sales Solution folder.a. Open the Payroll.vb file. Create a base class named Bonus. The class should contain two Public properties: a String property named SalesId and a Double property named Sales.
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
What are overloaded methods and why are they used?
Two or more methods that have the same name but different parameterLists are referred to as ___________________ methods.a. Loadedb. Overloadedc. Paralleld. Signature
Explain how the computer determines the appropriate constructor to use when instantiating an object using a class that contains more than one constructor.
The name of a class file ends with ___________________.a. .clab. .clsc. .vbd. None of the above
Open the VB2015\Chap11\Formula Solution\Formula Solution (Formula Solution.sln) file. Open the Areas.vb file, which contains the Parallelogram class definition. The class contains two Public properties and two constructors. It also contains a GetArea method that calculates the area of a
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
Open the VB2015\Chap10\Debug Solution\Debug Solution (Debug Solution.sln) file. Open the Code Editor window and study the existing code. Start the application. Test the application by entering Sue and 1000, and then by entering Pete and 5000. A run time error occurs. Read the error message. Click
In this exercise, you modify the application from Exercise 12. Use Windows to make a copy of the Average Solution folder. Rename the folder Modified Average Solution. Open the Average Solution (Average Solution.sln) file contained in the Modified Average Solution folder. Change the font used in the
In this exercise, you modify the application from Exercise 11. Use Windows to make a copy of the PAO Solution folder. Rename the folder Modified PAO Solution. Open the PAO Solution (PAO Solution.sln) file contained in the Modified PAO Solution folder. Modify the code to use a structure in the
Open the VB2015\Chap10\Average Solution\Average Solution (Average Solution.sln) file. The application should display a student’s name and the average of five test scores entered by the user.a. Create a structure named StudentInfo. The structure should contain two members: a String variable for
Create an application, using the following names for the solution and project, respectively: PAO Solution and PAO Project. Save the application in the VB2015\ Chap10 folder. Create the interface shown in Figure 10-34. The Party list box should contain three items: Democratic, Republican, and
In this exercise, you modify the Die Tracker application from Chapter 9. Copy the Die Solution folder from the VB2015\Chap09 folder to the VB2015\Chap10 folder, and then open the Die Solution (Die Solution.sln) file. Rather than using three parallel arrays, the application should use an array of
Open the VB2015\Chap10\Sales Solution\Sales Solution (Sales Solution.sln) file. The frmMain_Load procedure should read the five sales amounts contained in the sales.txt file, storing the amounts in a one-dimensional array and also displaying the amounts in the lstOriginal control. The sales.txt
Create an application, using the following names for the solution and project, respectively: Car Solution and Car Project. Save the application in the VB2015\Chap10 folder. Create the interface shown in Figure 10-17. Fill the list boxes in the frmMain_Load procedure. Create a structure that groups
Open the Test Scores Solution (Test Scores Solution.sln) file contained in the VB2015\ Chap10\Test Scores Solution folder. The btnSave_Click procedure should allow the user to enter an unknown number of test scores, saving each score in a sequential access file. The btnDisplay_Click procedure
In this exercise, you code an application that displays a grade based on the number of points entered by the user. The grading scale is shown in Figure 10-16. Open the VB2015\Chap10\Chang Solution\Chang Solution (Chang Solution.sln) file. Create a structure that contains two members: an Integer
Preston Enterprises stores employee IDs and salaries in a sequential access file named Employees.txt. Open the VB2015\Chap10\Preston Solution\Preston Solution (Preston Solution.sln) file. Open the Employees.txt file, which is contained in the project’s bin\ Debug folder. Each line contains an
Open the VB2015\Chap10\Pay Solution\Pay Solution (Pay Solution.sln) file. Open the Code Editor window. The application stores six hourly pay rates in a one= dimensional array named dblRates. Each rate corresponds to a pay code from 1 through 6. Code 1’s rate is stored in the dblRates(0) element
In this exercise, you modify the Paper Warehouse application completed in this lesson. Use Windows to make a copy of the Paper Solution-Structure folder. Rename the folder Modified Paper Solution-Structure. Open the Paper Solution (Paper Solution.sln) file contained in the Modified Paper
Create an application, using the following names for the solution and project, respectively: Commercial Solution and Commercial Project. Save the application in the VB2015\Chap10 folder. Each year, KJPR-Radio polls its audience to determine the best Super Bowl commercial. Create the interface shown
Open the VB2015\Chap10\States Solution\States Solution (States Solution.sln) file. Open the Code Editor window, and then open the states.txt file contained in the project’s bin\Debug folder. The sequential access file contains the names of five U.S. states. Close the states.txt window. The
What type of object is created by the AppendText method?a. Fileb. SequenceReaderc. StreamWriterd. None of the above
Open the VB2015\Chap10\City Solution\City Solution (City Solution.sln) file. Open the Code Editor window and review the existing code. Locate the btnDisplay_Click procedure. The procedure should display the contents of the array of structure variables in the list box, using the following format:
Zander Inc. stores employee IDs and salaries in a sequential access file named Employees.txt. Open the VB2015\Chap10\Zander Solution\Zander Solution (Zander Solution.sln) file. Open the Employees.txt file, which is contained in the project’s bin\Debug folder. The ID and salary information appear
Open the VB2015\Chap10\Bonus Solution\Bonus Solution (Bonus Solution.sln) file. The Save button should write the bonus amounts entered by the user to a sequential access file named bonus.txt. Save the file in the project’s bin\Debug folder. The Display button should read the bonus amounts from
What type of object is created by the OpenText method?a. Fileb. SequenceReaderc. StreamWriterd. None of the above
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 inventory.txt for output.
Open the VB2015\Chap09\City Solution\City Solution (City Solution.sln) file. Open the Code Editor window. The form’s Declarations section declares and initializes two parallel one-dimensional arrays named strCities and strStates. Locate the btnDisplay_Click procedure. The procedure should display
Which of the following statements changes the contents of the strWord variable from “sting” to “string”?a. strWord = strWord.AddTo(2, "r")b. strWord = strWord.Insert(2, "r")c. strWord = strWord.Insert(3, "r")d. strWord = strWord.Insert(3, "r"c)
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 the
In this exercise, you modify the eBook Collection application from this lesson. Use Windows to make a copy of the Ebook Solution folder. Rename the copy Ebook Solution-Structure. Open the Ebook Solution (Ebook Solution.sln) file contained in the Ebook Solution-Structure folder. Create a structure
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.
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
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 “AR456” to the strModel member contained in the first
Where is the Structure statement typically entered?a. The form’s Declarations sectionb. The Definition section in the Code Editor windowc. The form’s Load event procedured. The User-defined section in the Code Editor window
In this exercise, you modify the eBook Collection application from this lesson. Use Windows to make a copy of the Ebook Solution folder. Rename the copy Ebook Solution-Undo. Open the Ebook Solution (Ebook Solution.sln) file contained in the Ebook Solution-Undo folder. Add an Undo Remove button to
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
Write an If clause that determines whether the inventory.txt sequential access file exists.
What does the Peek method return when the end of the file is reached?a. –1b. 0c. The last character in the filed. The newline character
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 member.
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)
In this exercise, you modify the eBook Collection application from this lesson. Use Windows to make a copy of the Ebook Solution folder. Rename the copy Ebook Solution-No Duplicate. Open the Ebook Solution (Ebook Solution.sln) file contained in the Ebook Solution-No Duplicate folder. Before getting
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
Write the code to close the sequential access file associated with a StreamWriter variable named outFile.
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)
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 “KRZ45” to the strModel member. Finally, write an assignment statement that assigns the number 149.99 to
An array is declared using the statement Dim cities(10) As CityInfo. Which of the following statements assigns the number 4500 to the intPopulation member variable contained in the last array element?a. cities.intPopulation(10) = 4500b. cityInfo.cities.intPopulation = 4500c. cities(9).intPopulation
Open the VB2015\Chap10\Movies Solution\Movies Solution (Movies Solution.sln) file. The btnAdd_Click procedure should add the movie title entered in the text portion of the combo box to the list portion, but only if the title is not already in the list. The btnRemove_Click procedure should remove
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
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 inventory.txt for input.
If the file to be opened exists, the ___________________ method erases the file’s contents.a. AppendTextb. CreateTextc. InsertTextd. OpenText
Write a Structure statement that defines a structure named SongInfo. The structure contains three member variables named strName, strArtist, and strSongLength. Then write a Private statement that declares a SongInfo variable named mySongs.
The course structure variable contains a member variable named strGrade. Which of the following statements assigns the string “B” to the member variable?a. course.strGrade(0) = "B"b. course.strGrade = "B"c. strGrade.course = "B"d. None of the above
In this exercise, you modify the eBook Collection application from this lesson. Use Windows to make a copy of the Ebook Solution folder. Rename the copy Ebook Solution-Verify Remove. Open the Ebook Solution (Ebook Solution.sln) file contained in the Ebook Solution-Verify Remove folder. The
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)
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 =
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.
Which statement is used to create a user-defined data type?a. Declareb. Definec. Structured. UserType
In this exercise, you modify the eBook Collection application from this lesson. Use Windows to make a copy of the Ebook Solution folder. Rename the copy Ebook Solution-Verify Save. Open the Ebook Solution (Ebook Solution.sln) file contained in the Ebook Solution-Verify Save folder. The
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")
Open the VB2015\Chap09\Debug Solution\Debug Solution (Debug Solution.sln) file. Open the Code Editor window and review the existing code. The first column in the strNames array contains first names, and the second column contains last names. The btnDisplay_Click procedure should display the first
Research the Visual Basic ReDim statement. What is the purpose of the statement? What is the purpose of the Preserve keyword?a. Open the VB2015\Chap09\ReDim Solution\ReDim Solution (ReDim Solution.sln) file. Open the Code Editor window and locate the btnDisplay_Click procedure. Study the existing
Create an application, using the following names for the solution and project, respectively: Bindy Solution and Bindy Project. Save the application in the VB2015\ Chap09 folder. Bindy Enterprises sells the 10 items listed in Figure 9-61. Code the application in a way that allows the user to perform
In this exercise, you code an application that generates and displays six unique random numbers for a lottery game. Each lottery number can range from 1 through 54 only. Open the VB2015\Chap09\Lottery Solution\Lottery Solution (Lottery Solution.sln) file. (The image in the picture box is provided
Open the VB2015\Chap09\Count Solution\Count Solution (Count Solution.sln) file. The btnDisplay_Click procedure should display the number of times each of the numbers from 1 through 9 appears in the intNumbers array. Test the application appropriately.
In this exercise, you modify the application from Exercise 15. The modified application allows the user to display the number of salespeople earning a commission within a specific range. Use Windows to make a copy of the Commission Solution folder. Rename the folder Modified Commission Solution.
Open the VB2015\Chap09\Harrison Solution\Harrison Solution (Harrison Solution.sln) file. The btnDisplay_Click procedure should display the largest number stored in the first column of the array. Code the procedure using the For...Next statement. Test the application appropriately.
Open the VB2015\Chap09\Commission Solution\Commission Solution (Commission Solution.sln) file. The btnDisplay_Click procedure should declare a 20-element, onedimensional Integer array named intCommission. Assign the following 20 numbers to the array: 300, 500, 200, 150, 600, 750, 900, 150, 100,
Showing 1300 - 1400
of 1847
First
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Step by Step Answers