CIS170A Week 5 Quiz in vb – Study Guide – 100% score for this study guide

Lab Price = $9
Please feel free to send us your queries at: support@iqrajavaid.com

P.S: This is just a study guide. The questions may not appear exactly like this.
Payment methods

Add to Cart

Buy Now

View Cart


Problem Statement

1. (TCO 7) Modular programming uses a(n) _____ and _____ approach to problem solving. (Points : 3)
divide, conquer
breakdown, conquer
divide, simplify
abstraction, modular

2. (TCO 7) In Visual Basic, variables can be declared with what scope? (Points : 3)
Local
Universal
Global
Local and global
Local and universal

3. (TCO 7) The _____ statement is used to pass a value back to the calling code from a function. (Points : 3)
void
return
type
value parameter

4. (TCO 8) Which part of a function or sub procedure declaration statement is optional? (Points : 3)
Procedure name
Body code
Header
Parameters

5. (TCO 8) The process of passing only the value of a variable to a function or sub procedure is called _____. (Points : 3)
passing by reference
passing by value
localization
valuation of parameters

6. (TCO 8) Consider the following function call.

Dim letterGrade As String
letterGrade = CalcLetterGrade(95.5)

What would be a valid function declaration? (Points : 3)
Private Function CalcLetterGrade(ByVal dblX As Double) As Integer
Private Function CalcLetterGrade(ByVal dblX As Double) As String
Private Function CalcLetterGrade(ByVal dblX As Double) As Double
Private Function CalcLetterGrade(ByVal intX As Integer) As String

7. (TCO 8) What changes are required in the following code so that the resulting output is as follows?

Expected Output:
num1 = 2
num2 = 1
num3 = 3

Code:

Sub Main()

Dim num1 As Integer = 1
Dim num2 As Integer = 2
Dim num3 As Integer = 3

Swap(num1, num2, num3)
Console.WriteLine(“num1 = ” & num1)
Console.WriteLine(“num2 = ” & num2)
Console.WriteLine(“num3 = ” & num3)

End Sub

Sub Swap(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer)
Dim temp As Integer
temp = a
a = b
b = temp
End Sub (Points : 3)
Change function declaration to: Sub Swap(ByVal a As Integer, ByRef b As Integer, ByVal c As Integer).
Change function declaration to: Sub Swap(ByRef a As Integer, ByVal b As Integer, ByVal c As Integer).
Change function declaration to: Sub Swap(ByRef a As Integer, ByRef b As Integer, ByVal c As Integer).
No changes are required, the function works as expected.

8. (TCO 8) What is displayed when the following code is executed?

Sub Main()
Dim val1 As Integer = 4
Dim val2 As Integer = 5

Triple(val1, val2)
Console.WriteLine(“val1 = ” & val1)
Console.WriteLine(“val2 = ” & val2)

End Sub

Sub Triple (ByVal x As Integer, ByRef y As Integer)
Dim temp As Integer
temp = x
x = y
y = temp
End Sub (Points : 3)
val1 = 5
val2 = 4
val1 = 4
val2 = 4
val1 = 4
val2 = 5
None of the above

9. (TCO 7) Which of the following is NOT an advantage of creating modular code? (Points : 3)
The complexity of the code design decreases.
The amount of time required to code a program decreases.
Finding errors is easier.
Many people can work on related modules at the same time.

10. (TCO 7) Which of the following should NOT be considered when designing a module? (Points : 3)
The module should perform one single task.
The module should contain appropriate documentation.
The module should have a single entry point.
The module should allow for a flexible interface.

11. (TCO 8) What will be the output of the following program when it is executed?

Sub Main()

Dim num As Integer = 5
MultiplyAndPrint(num)
num = 7
MultiplyAndPrint(num)
num = 9
MultiplyAndPrint(num)

End Sub

Sub MultiplyAndPrint(ByVal num As Integer)
Dim strHold As String
If num >= 7 Then
strHold = “Result is: ” & (2 * num)
Else
strHold = “Result is: ” & (8 * num)
End If

System.Console.WriteLine(strHold)

End Sub (Points : 5)

Relevant Material
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at support@iqrajavaid.com.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at support@iqrajavaid.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at support@iqrajavaid.com.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on support@iqrajavaid.com
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.
Payment Details
Lab Price = $9
Please feel free to send us your queries at: support@iqrajavaid.com

Payment methods

Add to Cart

Buy Now

View Cart