1 Module Modulel Sub Main() Dim intArray() As Integer = {1.5, 5.2, 6.5, 12} Dim intFixed (3) As Integer 123456789 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 34 56 == Dim sngA As Single = Console.ReadLine() Dim sngB As Single = Console.ReadLine() Dim intN As Integer = Console.ReadLine() Dim Test Expression As Single = Math. Round ((sngB\ sngA + 1), 0) 'The value of TestExpression after line 8 is Dim sngSum As Single Select Case TestExpression Case 0 ReDim Preserve intArray (intN - 1) intArray (intN - 1) = sngA+ sngB For intCounter As Integer = 0 To (intN - 1) sngSum += intArray (intCounter) - sngA

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
1 Module Modulel
Sub Main()
3
4
5
6
7
8
9
10
12345678192812324252627 28 29 201233435 36初 38 39 48 4 2 3 4 45 46 7 48
20
37
40
41
42
43
44
Dim intArray() As Integer = {1.5, 5.2, 6.5, 12}
Dim intFixed (3) As Integer
Dim sngA As Single = Console.ReadLine()
Dim sngB As Single = Console.ReadLine()
Dim intN As Integer = Console.ReadLine()
Dim TestExpression As Single = Math. Round ((sngB sngA+ 1), 0)
'The value of TestExpression after line 8 is
Dim sngSum As Single
Select Case TestExpression
Case 0
ReDim Preserve intArray (intN - 1)
intArray (intN- 1) = sngA+ sngB
For intCounter As Integer = 0 To (intN - 1)
sngSum += intArray (intCounter) - sngA
intArray (intCounter) = sngSum
Next
Case Is < 5
47 End Module
For intCounter As Integer = 0 To UBound(intFixed)
intFixed (intCounter) = intArray (intCounter) + sngB
Next
sngSum= intFixed (1) + intArray(2) + sngA
Case 2, 5, 8
ReDim intArray (intN - 1)
For intCounter As Integer = 1 To UBound(intArray)
intArray (intCounter) += 1.5
Next
For intCounter = 0 To (intN - 1)
sngSum+ intArray (intCounter)
intFixed (intCounter) = sngSum
Next
Case Else
ReDim Preserve intArray (sngB)
sngSum = intArray (0) + intArray(2) + intArray (sngB)
intFixed(sngA) = sngSum
End Select
'What is the final value of sngSum?
'What is the final length of intArray and intFixed? List the final
elements of both for each set of inputs
End Sub
'input values for sngA, sngB and intN, respectively
3
'a. 1.5
'b. 3.5
'c. -1.5
'd. 1.2
9
7
1.5
6.5
4
5
2
Transcribed Image Text:1 Module Modulel Sub Main() 3 4 5 6 7 8 9 10 12345678192812324252627 28 29 201233435 36初 38 39 48 4 2 3 4 45 46 7 48 20 37 40 41 42 43 44 Dim intArray() As Integer = {1.5, 5.2, 6.5, 12} Dim intFixed (3) As Integer Dim sngA As Single = Console.ReadLine() Dim sngB As Single = Console.ReadLine() Dim intN As Integer = Console.ReadLine() Dim TestExpression As Single = Math. Round ((sngB sngA+ 1), 0) 'The value of TestExpression after line 8 is Dim sngSum As Single Select Case TestExpression Case 0 ReDim Preserve intArray (intN - 1) intArray (intN- 1) = sngA+ sngB For intCounter As Integer = 0 To (intN - 1) sngSum += intArray (intCounter) - sngA intArray (intCounter) = sngSum Next Case Is < 5 47 End Module For intCounter As Integer = 0 To UBound(intFixed) intFixed (intCounter) = intArray (intCounter) + sngB Next sngSum= intFixed (1) + intArray(2) + sngA Case 2, 5, 8 ReDim intArray (intN - 1) For intCounter As Integer = 1 To UBound(intArray) intArray (intCounter) += 1.5 Next For intCounter = 0 To (intN - 1) sngSum+ intArray (intCounter) intFixed (intCounter) = sngSum Next Case Else ReDim Preserve intArray (sngB) sngSum = intArray (0) + intArray(2) + intArray (sngB) intFixed(sngA) = sngSum End Select 'What is the final value of sngSum? 'What is the final length of intArray and intFixed? List the final elements of both for each set of inputs End Sub 'input values for sngA, sngB and intN, respectively 3 'a. 1.5 'b. 3.5 'c. -1.5 'd. 1.2 9 7 1.5 6.5 4 5 2
Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY