Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is vba in excel. Function Da(k As ____, tau As ____) As Variant \'k= time s

ID: 3673009 • Letter: T

Question

This is vba in excel.

Function Da(k As ____, tau As ____) As Variant

'k= time scale, tau = residence time, Da = Damkohler number

Da = k * tau

End Function

Sub Damkohler()

Dim a As Variant

Dim b As Variant

Dim c As Variant

Dim i As Integer

a = 2 * Cells(1, 1).Value

b = Cells(2, 1).Value

If IsNumeric(a) And IsNumeric(b) And a > 0 And b > 0 Then

b = Da(a, b)

Cells(3, 1).Value = c

Cells(3, 3).Value = "NO"

Else

MsgBox ("Invalid Input")

Cells(3, 1).Value = "Error"

Cells(5, 3).Value = "YES"

i = i + 2

End If

End Sub

1. Fill in the blanks for the first line of code NOTE: Both lines can will use the same datatype

2. What is the final value of the variable c?

3. What is the final value of cell (3,1)

4. What is the initial value of the variable i? NOTE: Whenever asked for the initial value of a variable - it will be the first assignment to that variable

5. What is the final value of the variable i?

R1C1 2 4 2 YES NO

Explanation / Answer

the data types for k and tau should be integer as they should be numeric.

c will be 0 as value won't be changed. The value given to parameter b in the code is not numeric(e) so it will go to the else part of the if condition and will cause problem.

Initial value of i will be zero. Now else part of the code will be executed. i will become 2 now.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote