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
Bundle Programming With Microsoft Visual Basic 2015 7th + Mindtap Programming 1 Term Printed Access Card 7th Edition Diane Zak - Solutions
8. In this exercise, you modify one of the Concert Tickets applications from this lesson. Use Windows to make a copy of the Concert Solution-Sub folder. Rename the copy Modified Concert Solution-Sub. Open the Concert Solution (Concert Solution.sln) file contained in the Modified Concert
7. In this exercise, you modify the Favorites application from this lesson. Use Windows to make a copy of the Favorites Solution folder. Rename the copy Modified Favorites Solution. Open the Favorites Solution (Favorites Solution.sln) file contained in the Modified Favorites Solution folder. Modify
6. In this exercise, you experiment with passing variables by value and by reference. Open the VB2015\Chap07\Passing Solution\Passing Solution (Passing Solution.sln) file.a. Open the Code Editor window and review the existing code. Notice that the strMyName variable is passed by value to the
5. Write the code for a function that receives a copy of the value stored in an Integer variable. The function should divide the value by 2 and then return the result, which may contain a decimal place. Name the function GetQuotient. Then write an appropriate statement to invoke the function,
4. Write the code for a Sub procedure that receives three Integer variables: the first two by value and the last one by reference. The procedure should multiply the first variable by the second variable and then store the result in the third variable. Name the procedure CalcProduct.
3. Write the code for a function named GetState. The function should prompt the user to enter the name of a U.S. state and then return the user’s response. Then write a statement to invoke the GetState function. Display the function’s return value in a message box.
2. Write the code for a Sub procedure named GetState. The procedure should prompt the user to enter the name of a U.S. state, storing the user’s response in its strState parameter. Then write a statement to invoke the procedure, passing it the strName variable.
1. Write the code for a Sub procedure that receives a Double number passed to it.The procedure should multiply the number by 1.5 and then display the result in the lblAnswer control. Name the procedure IncreaseNum. Then write a statement to invoke the procedure, passing it the number 75.5.
20. Explain the difference between invoking a Sub procedure and invoking a function.
19. Explain the difference between passing a variable by value and passing it by reference.
18. Explain the difference between a Sub procedure and a Function procedure.
17. Which of the following statements invokes the GetDiscount function, passing it the contents of two Decimal variables named decSales and decRate? The statement should assign the function’s return value to the decDiscount variable.a. decDiscount = Call GetDiscount(decSales, decRate)b. Call
16. The memory locations listed in the parameterList in a procedure header have procedure scope and are removed from the computer’s internal memory when the procedure ends.a. Trueb. False
15. Which of the following statements should you use to call the GetEndingInventory procedure described in Review Question 14?a. Call GetEndingInventory(intBegin, intSales, intPurchases, intEnding)b. Call GetEndingInventory(ByVal intBegin, ByVal intSales, ByVal intPurchases, ByRef intEnding)c. Call
14. A Sub procedure named GetEndingInventory is passed four Integer variables named intBegin, intSales, intPurchases, and intEnding. The procedure should calculate the ending inventory using the beginning inventory, sales, and purchase amounts passed to the procedure. The result should be stored in
13. Which of the following is false?a. When you pass a variable by reference, the receiving procedure can change its contents.b. To pass a variable by reference in Visual Basic, you include the ByRef keyword before the variable’s name in the Call statement.c. When you pass a variable by value,
12. If the statement Call CalcNet(decNetPay) passes the variable’s address, the variable is said to be passed _____________________.a. by addressb. by contentc. by referenced. by value
11. Which of the following is a valid header for a procedure that is passed the number 15?a. Private Function GetTax(ByVal intRate As Integer) As Decimalb. Private Function GetTax(ByAdd intRate As Integer) As Decimalc. Private Sub CalcTax(ByVal intRate As Integer)d. both a and c
10. Which of the following is a valid header for a procedure that receives the address of a Decimal variable followed by an integer?a. Private Sub GetFee(ByVal decX As Decimal, ByAdd intY As Integer)b. Private Sub GetFee(decX As Decimal, intY As Integer)c. Private Sub GetFee(ByRef decX As Decimal,
9. Which of the following instructs a function to return the contents of the dblBonus variable?a. Return dblBonusb. Return ByVal dblBonusc. Send dblBonusd. SendBack dblBonus
8. Which of the following is false?a. The order of the arguments listed in the Call statement should agree with the order of the parameters listed in the receiving procedure’s header.b. The data type of each argument in the Call statement should match the data type of its corresponding parameter
7. Which of the following is a valid header for a procedure that receives an integer followed by a number with a decimal place?a. Private Sub GetFee(intBase As Value, decRate As Value)b. Private Sub GetFee(ByRef intBase As Integer, ByRef decRate As Decimal)c. Private Sub GetFee(ByVal intBase As
6. Which of the following is a valid header for a procedure that receives a copy of the value stored in a String variable?a. Private Sub DisplayName(ByContents strName As String)b. Private Sub DisplayName(ByValue strName As String)c. Private Sub DisplayName ByVal(strName As String)d. none of the
5. Which of the following statements invokes the GetArea Sub procedure, passing it two variables by value?a. Call GetArea(dblLength, dblWidth)b. Call GetArea(ByVal dblLength, ByVal dblWidth)c. Invoke GetArea(dblLength, dblWidth)d. GetArea(dblLength, dblWidth) As Double
4. To determine whether a variable is being passed to a procedure by value or by reference, you will need to examine _____________________.a. the Call statementb. the procedure headerc. the statements entered in the procedured. either a or b
3. Each memory location listed in the parameterList in the procedure header is referred to as _____________________.a. an addressb. a constraintc. a parameterd. a value
2. The items listed in the Call statement are referred to as _____________________.a. argumentsb. parametersc. passersd. none of the above
1. Which of the following is false?a. A function can return only one value to the statement that invoked it.b. A Sub procedure can accept only one item of data passed to it.c. The parameterList in a procedure header is optional.d. At times, a variable inside the computer’s internal memory may
11. Open the VB2015\Chap06\Car Solution\Car Solution (Car Solution.sln) file.(The image is provided courtesy of OpenClipArt.org/Keistutis.) The btnClickMe_Click procedure should make the “I WANT THIS CAR!” message blink 10 times. In other words, the message should disappear and then reappear,
10. Create an application, using the following names for the solution and project, respectively: Bar Chart Solution and Bar Chart Project. Save the application in the VB2015\Chap06 folder. The application should allow the user to enter the ratings for five different movies. Each rating should be a
9. Create an application, using the following names for the solution and project, respectively: New Salary Solution and New Salary Project. Save the application in the VB2015\Chap06 folder. Assume that at the beginning of every year, you receive a raise on your previous year’s salary. Create a
8. Create an application, using the following names for the solution and project, respectively: Barclay Solution and Barclay Project. Save the application in the VB2015\Chap06 folder. The application’s interface is shown in Figure 6-72. The Calculate button’s Click event procedure should use a
7. Create an application, using the following names for the solution and project, respectively: Table Solution and Table Project. Save the application in the VB2015\Chap06 folder. The application should display a table consisting of four rows and five columns. The first column should contain the
6. Open the VB2015\Chap06\Grade Solution\Grade Solution (Grade Solution.sln) file.Professor Mason wants you to create an application that allows her to assign a grade to any number of students. Each student’s grade is based on four test scores, with each test worth 100 points. The application
5. In this exercise, you modify the Modified Savings Account application from this lesson.Use Windows to make a copy of the Modified Savings Solution folder. Rename the copy Modified Savings Solution-Intermediate. Open the Savings Solution (Savings Solution.sln) file contained in the Modified
4. In this exercise, you modify the Savings Account application from this lesson. Use Windows to make a copy of the Savings Solution folder. Rename the copy Savings Solution-Intermediate. Open the Savings Solution (Savings Solution.sln) file contained in the Savings Solution-Intermediate folder. In
3. In this exercise, you modify the Clock application from this lesson. Use Windows to make a copy of the Clock Solution folder. Rename the copy Clock Solution-Intermediate. Open the Clock Solution (Clock Solution.sln) file contained in the Clock Solution-Intermediate folder. In the btnStart_Click
2. In this exercise, you modify the Savings Account application from this lesson. Use Windows to make a copy of the Savings Solution folder. Rename the copy Savings Solution-Introductory. Open the Savings Solution (Savings Solution.sln) file contained in the Savings Solution-Introductory folder. In
1. In this exercise, you modify the Clock application from this lesson. Use Windows to make a copy of the Clock Solution folder. Rename the copy Clock Solution-Introductory. Open the Clock Solution (Clock Solution.sln) file contained in the Clock Solution-Introductory folder. Open the Code Editor
4. Which of the following statements pauses program execution for one second?a. System.Threading.Thread.Pause(1000)b. System.Threading.Thread.Pause(1)c. System.Threading.Thread.Sleep(1000)d. System.Threading.Thread.Sleep(100)
3. What will the following code display in the lblSum control?Dim intSum As Integer Dim intY As Integer Do While intY < 3 For intX As Integer = 1 To 4 intSum += intX Next intX intY += 1 Loop lblSum.Text = intSum.ToStringa. 5b. 8c. 15d. 30
2. What will the following code display in the lblAsterisks control? For intX As Integer = 1 To 2 For intY As Integer = 1 To 3 1b1Asterisks.Text = 1blAsterisks.Text & "*" Next intY lblAsterisks.Text = 1blAsterisks.Text & Control Chars.NewLine Next intx a. b. *** C. ** d. ***
1. A procedure allows the user to enter one or more values. The first input instruction will get the first value only and is referred to as the _____________________ read.a. enteringb. initializerc. primingd. starter
15. Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\Debug Solution-B15 folder. Open the Code Editor window and review the existing code. Start and then test the application. Be sure to include non-integers in your test data. (Hint: If you need to stop an endless
14. In this exercise, you learn how to use the String Collection Editor window to fill a list box with values. Open the VB2015\Chap06\ListBox Solution\ListBox Solution (ListBox Solution.sln) file. Open the Code Editor window. Remove the Add methods and the For...Next statement from the form’s
13. In this exercise, you learn how to use the Items collection’s Insert, Remove, RemoveAt, and Clear methods. You also learn how to use the Items collection’s Count property.Open the VB2015\Chap06\Items Solution\Items Solution (Items Solution.sln) file.a. The Items collection’s Insert method
12. In this exercise, you learn how to create a list box that allows the user to select more than one item at a time. Open the VB2015\Chap06\Multi Solution\Multi Solution(Multi Solution.sln) file. The interface contains a list box named lstNames. The list box’s Sorted and SelectionMode properties
11. The accountant at Canton Manufacturing Company wants you to create an application that calculates an asset’s annual depreciation using the double-declining balance and sum-of-the-years’ digits methods. The accountant will enter the asset’s cost, useful life (in years), and salvage value
10. Open the VB2015\Chap06\Fibonacci Solution\Fibonacci Solution (Fibonacci Solution.sln)file. The application should display the first 10 Fibonacci numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, and 55. Notice that beginning with the third number in the series, each Fibonacci number is the sum of the
9. Open the VB2015\Chap06\Random Solution\Random Solution (Random Solution.sln)file. The application should give the user 10 chances to guess a random number generated by the computer. The random number should be an integer from 1 through 50, inclusive.Each time the user makes an incorrect guess,
8. In this exercise, you create an application that allows the user to enter the gender (either F or M) and GPA for any number of students. The application’s interface is shown in Figure 6-53. The application should calculate the average GPA for all students, the average GPA for male students,
7. Mills Skating Rink holds a weekly ice-skating competition. Competing skaters must perform a two-minute program in front of a panel of judges. The number of judges varies from week to week. At the end of a skater’s program, each judge assigns a score of 0 through 10 to the skater. The manager
6. In this exercise, you modify the Monthly Payment application from this lesson. Use Windows to make a copy of the Payment Solution folder. Rename the copy Modified Payment Solution. Open the Payment Solution (Payment Solution.sln) file contained in the Modified Payment Solution folder. Modify the
5. In this exercise, you create an application for Discount Warehouse. The interface should allow the user to enter an item’s original price and its discount rate. The discount rates should range from 10% through 40% in increments of 5%. Use a text box for entering the original price, and use a
4. Create an application, using the following names for the solution and project, respectively:President Solution and President Project. Save the application in the VB2015\Chap06 folder. Add the names of five U.S. presidents of your choosing to a list box.When the user clicks a name in the list
3. In this exercise, you modify the application from Exercise 2. Use Windows to make a copy of the Zip Solution folder. Rename the copy Modified Zip Solution. Open the Zip Solution(Zip Solution.sln) file contained in the Modified Zip Solution folder. Modify the list box’s SelectedValueChanged
2. In this exercise, you create an application that displays the ZIP code (or codes) corresponding to the city name selected in a list box. The city names and ZIP codes are shown in Figure 6-51. Create the application, using the following names for the solution and project, respectively: Zip
1. In this exercise, you modify the Monthly Payment application from this lesson. Use Windows to make a copy of the Payment Solution folder. Rename the copy Payment Solution-DoLoop. Open the Payment Solution (Payment Solution.sln) file contained in the Payment Solution-DoLoop folder. Change both
29. Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\Debug Solution-A29 folder. The code should display a 5% commission for each sales amount that is entered, but it is not working correctly. Correct the code.
28. Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\Debug Solution-A28 folder. The code should display the numbers 10 through 1, but it is not working correctly. Correct the code. (Hint: If you need to stop an endless loop, click the Stop Debugging button on the
27. Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\Debug Solution-A27 folder. The code should display the numbers 1 through 4, but it is not working correctly. Correct the code. (Hint: If you need to stop an endless loop, click the Stop Debugging button on the
26. Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\Debug Solution-A26 folder. The code should display a 10% bonus for each sales amount that is entered, but it is not working correctly. Correct the code. (Hint: If you need to stop an endless loop, click the Stop
25. Create an application, using the following names for the solution and project, respectively: General Solution and General Project. Save the application in the VB2015\Chap06 folder. The application’s interface is shown in Figure 6-32. The interface allows the user to enter an item’s price,
24. Open the VB2015\Chap06\Multiplication Solution (Multiplication Solution.sln) file. Code the application to display a multiplication table similar to the one shown in Figure 6-31.Use the For...Next statement in the btnForNext_Click procedure, and use the Do...Loop statement in the
23. In this exercise, you modify one of the Projected Sales applications from this lesson.Use Windows to make a copy of the Sales Solution-For Next folder. Rename the copy Sales Solution-Do While. Open the Sales Solution (Sales Solution.sln) file contained in the Sales Solution-Do While folder.
22. In this exercise, you modify the Addition application from this lesson. Use Windows to make a copy of the Addition Solution folder. Rename the copy Addition Solution-Intermediate. Open the Addition Solution (Addition Solution.sln) file contained in the Addition Solution-Intermediate folder. The
21. In this exercise, you modify one of the Projected Sales applications from this lesson.Use Windows to make a copy of the Sales Solution folder. Rename the copy Sales Solution-Intermediate. Open the Sales Solution (Sales Solution.sln) file contained in the Sales Solution-Intermediate folder.
20. What will the following code display?Dim intTotal As Integer Do MessageBox.Show(intTotal.ToString)intTotal = intTotal + 2 Loop Until intTotal >= 2
19. What will the following code display?Dim intTotal As Integer Do While intTotal
18. Write a For...Next statement that calculates and displays the squares of odd numbers from 3 through 15 (e.g., 9, 25, and so on). Display each number on a separate line in the lblNums control.
17. Write a For...Next statement that displays the numbers from 6 through 60 in increments of 6 in the lblNums control. Display each number on a separate line in the control.
16. Write the Visual Basic code that corresponds to the flowchart shown in Figure 6-30.Display the calculated results on separate lines in the lblCount control. start initialize counter to 5 T counter
15. Rewrite the pretest loop from Exercise 14 as a posttest loop. Add another button to the interface used in Exercise 14. Enter your code from this exercise in the button’s Click event procedure. Test the application appropriately.
14. Rewrite the pretest loop from Exercise 13 using the Do...Loop statement. Add another button to the interface created in Exercise 13. Enter your code from this exercise in the button’s Click event procedure, and then test the application appropriately.
13. Write the Visual Basic code for a pretest loop that uses an Integer variable named intEven to display the even integers from 2 through 20 in the lblEven control. Use the For...Next statement. Display each number on a separate line in the control. Then create an application to test your code
12. Modify Solution 2 shown earlier in Figure 6-4. The solution should now keep track of the number of times Sahirah’s laser beam missed the spider. After saying “You are safe now.The spider is dead.”, Sahirah should say one of the following: “I got him immediately.”; “I missed him one
11. Write a Visual Basic assignment statement that subtracts the contents of the decReturns variable from the contents of the decSales accumulator variable.
10. Write a Visual Basic assignment statement that updates the intTotal counter variable by –3.
9. Figure 6-29 shows a problem specification, two illustrations, and two solutions containing loops.a. Will both loops work when Sherri is one or more steps away from the fountain, as shown in Illustration A? If not, why not?b. Will both loops work when Sherri is directly in front of the fountain,
8. Write a Visual Basic assignment statement that updates the decTotal accumulator variable by the value stored in the decSales variable.
7. Write a Visual Basic assignment statement that updates the intTotal counter variable by 3.
6. What will the following code display in message boxes?Dim intX As Integer = 1 Do MessageBox.Show(intX.ToString)intX = intX + 1 Loop Until intX > 5
5. What will the following code display in message boxes?Dim intX As Integer = 1 Do While intX < 5 MessageBox.Show(intX.ToString)intX += 1 Loop
4. Write a Visual Basic Do clause that processes the loop instructions as long as the value in the strName variable is not “Done” (in any case). Use the While keyword. Then rewrite the Do clause using the Until keyword.
3. Write a Visual Basic Loop clause that processes the loop instructions as long as the value in the strContinue variable is either Y or y. Use the While keyword. Then rewrite the Loop clause using the Until keyword.
2. Write a Visual Basic Do clause that stops the loop when the value in the intOrdered variable is greater than the value in the intOnHand variable. Use the Until keyword.Then rewrite the Do clause using the While keyword.
1. Write a Visual Basic Do clause that processes the loop instructions as long as the value in the intNum variable is less than or equal to the number 100. Use the While keyword. Then rewrite the Do clause using the Until keyword.
14. The loop controlled by the correct For clause from Review Question 13 will end when the intX variable contains the number _____________________.a. 100b. 111c. 101d. 110
13. Which of the following For clauses indicates that the loop instructions should be processed as long as the intX variable’s value is less than 100?a. For intX As Integer = 10 To 100b. For intX As Integer = 10 To 99c. For intX As Integer = 10 To 101d. none of the above
12. Which of the following statements is equivalent to the statement dblTotal = dblTotal + dblScore?a. dblTotal += dblScoreb. dblScore += dblTotalc. dblTotal =+ dblScored. dblScore =+ dblTotal
11. Which of the following control structures are used in flowchart D in Figure 6-28?(Select all that apply.)a. sequenceb. selectionc. repetitio 0+ F H
10. Which of the following control structures are used in flowchart C in Figure 6-28?(Select all that apply.)a. sequenceb. selectionc. repetition 0+ F H
9. Which of the following control structures are used in flowchart B in Figure 6-28?(Select all that apply.)a. sequenceb. selectionc. repetition 0+ F H
8. Which of the following control structures are used in flowchart A in Figure 6-28?(Select all that apply.)a. sequenceb. selectionc. repetition F 0+ F
. The computer will stop processing the loop in Review Question 6 when the intCount variable contains the number _____________________ .a. 11b. 12c. 13d. 14
6. How many times will the MessageBox.Show method in the following code be processed?For intCount As Integer = 6 To 13 Step 2 MessageBox.Show("Hello")Next intCounta. threeb. fourc. fived. eight
5. How many times will the MessageBox.Show method in the following code be processed?Dim intCount As Integer Do MessageBox.Show("Hello")intCount += 1 Loop While intCount > 4a. zerob. onec. fourd. five
4. How many times will the MessageBox.Show method in the following code be processed?Dim intCount As Integer Do While intCount > 4 MessageBox.Show("Hello")intCount += 1 Loopa. zerob. onec. fourd. five
3. The instructions in a _____________________ loop might not be processed at all, whereas the instructions in a _____________________ loop are always processed at least once.a. posttest, pretestb. pretest, posttest
2. Which of the following statements can be used to code a loop whose instructions you want processed 10 times?a. Do...Loopb. For...Nextc. either a or b
Showing 400 - 500
of 1847
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers