Programming with Microsoft Visual Basic 2017
8th Edition
ISBN: 9781337102124
Author: Diane Zak
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 8, Problem 20RQ
Program Description Answer
All of the given statements are used to assign the number 0 to each element in a 2-row, 4-column integer array named intSums.
Hence, the correct answer is option “D”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The logic will allow the user to:
Load a single dimensional array of size 50 with a random number
The random number will range from 1 to 1,000 (you may have duplicate values)
Find the highest value and the index location that it was in
Find the smallest value and the index location that it was in
Display the array’s contents.
Display the highest value and its index location
Display the lowest value and its index location
Allow the user to execute this application multiple times (some sort of loop?)
You will need one for loop to load the array as well as one or two for loops to search that array.
The rand also has a “nasty” tendency to create the same results repeatedly in an exe. To avoid that, we have to “shuffle the deck” every time. This ensures that all numbers are an equal probability of appearing and not the same set of values (would create a boring game).
// Add this to "shuffle the deck" every time to ensure that
// different values could occur else the exe produces the…
The names of the 12 months are stored in the strMonths array. The bonus paid for each month is stored in a parallel array named intBonuses. If the sixth element in the strMonths array contains the string “June”, which of the following assigns the June bonus amount, which is 34000, to the appropriate element?a. intBonuses(5) = 34000b. intBonuses(5) = "34000"
c. intBonuses(6) = 34000d. intBonuses(7) = 34000
The intNum array is declared as follows: Dim intNum(,) As Integer = {{6, 12, 9, 5, 2}, {35, 60, 17, 8, 10}}. 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 intNum(intRow, intCol) >= 0 AndAlso intNum(intRow, intCol) < 5 Then b. If intNum(intRow, intCol) >= 0 AndAlso intNum(intRow, intCol) <= 5 Then c. If intRow >= 0 AndAlso intRow < 3 AndAlso intCol >= 0 AndAlso intCol < 6 Then d. If intRow >= 0 AndAlso intRow < 2 AndAlso intCol >= 0 AndAlso intCol < 5 Then
Chapter 8 Solutions
Programming with Microsoft Visual Basic 2017
Knowledge Booster
Similar questions
- If the intNums array contains six elements, which of the following statements assigns the number 6 to the intElements variable? intElements = Len(intNums) intElements = Length(intNums) intElements = intNums.Len intElements = intNums.Lengtharrow_forwardWrite a statement that declares a procedure-level one-dimensional array named intorders. The array should contain 15 elements.arrow_forward(Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().arrow_forward
- 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)arrow_forwardThe strState and strCapital arrays are parallel arrays. If Illinois is stored in thesecond element in the strState array, where is Springfield stored?a. strCapital(1)b. strCapital(2)arrow_forwardIf the intNums array contains six elements, which of the following statements assigns the number 6 to the intElements variable? a. intElements = Len(intNums) b. intElements = Length(intNums) c. intElements = intNums.Len d. intElements = intNums.Lengtharrow_forward
- 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?strCapitals(0)strCapitals(1)strCapitals(2)strCapitals(3)arrow_forwardUsing C# in Microsoft Visual Studio Create an application that simulates a game of tic-tac-toe. The application should use a two-dimensional int array to simulate the game board in memory. When the user clicks the New Game button, the application should step through the array, storing a random number in the range of 0 through 1 in each element.The number 0 represents the letter O, and the number 1 represents the letterX. The form should then be updated to display the game board. The application should display a message indicating whether player X won, player Y won, or the game was a tie.arrow_forwardThe question:You are required to develop an application to determine the maximum value in a 2-dimension array as displayed in figure 1. You are required to:• Declare a 4-by-5 array.• The array should be initialized with the values as shown in Table 1.• Display all the array values as per example in Figure 1.• Display the maximum (highest) value as well as the maximum values row and column subscriptas per example in Figure 1.arrow_forward
- What values will be written to the array when the following code executes? data array DWORD 4 DUP(0) code main PROC mov eax, 5 mov esi, 0 call proc_1 add esi,4 add eax 3 k mov array[esi] eax INVOKE ExitProcess 0 main ENDF proc 1 PROC call proc_2 add esi, 4 add eax, 3 mov array[esi], eax ret proc 1 ENDP proc 2 PROC call proc_3 add esi.4 add eax 3 mov array[esi] eax ret Proc RENDE proc_3 PROC mov array[esi] eax ProcA ENDP Answer: arrayarrow_forwardThe strItems array is declared as follows: Dim strItems(20) As String. The intSub variable keeps track of the array subscripts and is initialized to 0. Which of the following Do clauses will process the loop instructions for each element in the array? a. Do While intSub > 20 b. Do While intSub < 20 c. Do While intSub >= 20 d. Do While intSub <= 20arrow_forwardWhich of the following adds the number 20 to the value stored in the first row, second column of the decSales array?a. decSales(0, 1) += 20b. decSales(1, 2) = decSales(1, 2) + 20c. decSales(1, 2) += 20d. both b and carrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning