ENGS 116 Final

Ace your homework & exams now with Quizwiz!

Which formula will calculate the most accurate answer for the area of a circle? The radius of the circle is stored in cell A1. Choose the answer that reduces the error in the calculation.

PI() * A1^2

You are writing a program to calculate the area of a cylinder. What is the correct syntax for displaying the value of the variable cylinderArea in cell B1?

Range("B1").Value = cylinderArea

You are writing a program to calculate the area of a cylinder and need the user to input the radius of the cylinder in cell B1 on a spreadsheet. What is the correct syntax for getting the radius from cell B1 and storing it in a variable called radius?

radius = Range("B1").Value

Option Explicit Sub checkValueForA() Dim a As Integer a = 11 Do While a <> 8 a = a -2 Loop MsgBox a End Sub -what will be displayed in the message box

the loop will run infinitely and crash

Option Explicit Sub mainProgram() Dim a As Integer a = 3 Call calledProgram MsgBox a End Sub Sub calledProgram() a = a * a End Sub -what will be shown in the message box

this code won't execute since the variable a is not defined in the sub named calledProgram

Which equation represents the Excel formula: =2*A1-(A1/(3+A1)). The variable x represents the cell reference A1.

y=2x-( x / 3 + x)

Cell B1 contains the number 1 and cell B2 contains the number 2. If you were to type '=B2-B1 into cell B3 and press enter, what would be displayed in cell B3 on the worksheet?

=B2-B1

Cell D4 contains the formula =A3 + $B$2/C1. If this cell was copied into cell E6, what would be the formula in cell B4?

=B5 + $B$2 / D3

Cell C1 contains the formula =$A$1*B1. If you were to select cell C1 and then use the autofill feature (clicking the green fill handle and dragging down) to fill additional cells, what would be the value of cell C3?

$A$1*B3

What size is this matrix? A=[5 3 12; 12 22 7]

(2 x 3)

Matrix A is (7 × 2) and matrix B is (2 × 3). What is the size of the matrix product of A × B?

(7 x 3)

Which formula will add the value of cell A2 to the value of cell B2 and then divide the result by the value in cell C4:

(A2 + B2)/C4

Which formula will subtract the value of cell A2 from the value of cell B2 and then multiply the result by the value in cell C4?

(B2-A2)*C4

What value will be stored in the variable c when the following statement is executed? c = 2 ^ 2 - 1 * (4 - 2) * 2 ^ 2 + 3

-1

Sub blockCheck() Dim a As Single, B As Single, c As Single a = 5 b = 2 If a >= (b+4) Or B <> 2 Then c = 3 ElseIf a <= 7 And a = (b+2) Then c = 2 Else c = 1 End If End Sub -what value will be stored in the variable c

1

Sub decisionMaker() Dim a As Single, b As SIngle, c As Single a = 6 b = 2 If a >= (3 * b) Then c = a * b Else c = 1 End If End Sub -what value will be stored in the variable c

12

Option Explicit Sub loopingExample() Dim a As Integer, n As Integer a = 2 For n = 1 To 7 Step 3 a = a + n Next n MsgBox a End Sub -what is the value stored in a

14

Cell A1 contains the number 10 and cell A2 contains the number 20. If you were to select only cell A1 and then use the autofill feature (clicking the green fill handle and dragging down) to fill additional cells, what would be the value of cell A5?

10

For the spreadsheet below, what value or values will appear in cell A5 after typing =SUM(A1:A4) into cell A5 and pressing enter? A 1 1 2 2 3 3 4 4 5

10

Which of the following formulas will return a random number between 0 and 10?

10 * RAND()

For the spreadsheet below, what value will appear in cell A5 after typing =MAX(A1:A4) into cell A5 and pressing enter? A 1 3 2 12 3 5 4 3 5

12

Option Explicit Sub doSomeMath() Dim a As Integer, b As Integer, c As Integer, d As Integer a = 24 b = 2 c = a / b d = c MsgBox d End Sub -what will be displayed in the message box

12

Option Explicit Sub program1() Dim a As Single, b As Single, c As Single a = 2 b = 7 c = multiplyValues (a, b) End Sub Function multiplyValues(a As Single, b As Single) As Single multiplyValues = a * b End Function -what will be stored in the variable c

14

Sub loopingExample() Dim a As Integer, n As Integer a = 6 For n = 1 To 5 Step 2 a = a + n Next n End Sub -what value will be stored in a

15

Evaluate the formula =A1+A2/(B1-B2) if A1 = 10, A2 = 6, B1 = 3, and B2 = 2:

16

Option Explicit Sub doubleLoop() Dim value1 As Integer, i As Integer, j As Integer value1 = 4 For j = 1 To 2 For i = 1 To 3 value1 = value1 + 2 Next i Next j End Sub

16

Sub calculateValue() Dim a As Integer, b As Integer, c As Integer a = 12 b = 3 c = a / b c = c^2 MsgBox c End Sub -what will be displayed in the message box

16

Evaluate the formula =A10/B3*E1 if A10 = 12, B3 = 2, and E1 = 3:

18

Option Explicit Sub caclulateValue() Dim a As Integer, b As Integer, c As integer a = 3 b = 2 c = a * b c = c * a MsgBox c End Sub -what will be displayed in the message box

18

Evaluate the formula =A1/A2/A3 if A1 = 24, A2 = 6, A3 = 2:

2

How should this formula be implemented in Excel? The value for x is stored in cell A1. y = (2x)((3−x)/(4+x))

2*A1*(3-A1)/4+A1)

Cell A2 contains the formula =2*A1+$A$1. If this cell was copied into cell B2, what would be the formula in cell B2?

2*B1+$A$1

Which of the following formulas will return a random number between 10 and 30 only?

20 * RAND() + 10

Evaluate the formula =(A1-A2)/(B1-B2) if A1 = 10, A2 = 4, B1 = 4, and B2 = 2:

3

Evaluate the formula =A1/A2^2 if A1 = 12, and A2 = 2:

3

Evaluate the formula =A1*A2^(B1-B2) if A1 = 2, A2 = 4, B1 = 3, and B2 = 1:

32

Option Explicit Sub decisionForG() Dim a As Single, b As Single, c As Single, g As Single a = 16 b = 4 c = -2 If a > (a /b) Or c <> 0 Then g = 4 Else If b = 4 Then g = 3 Else g = 2 End If End Sub -what will be stored in the variable g

4

Option Explicit Sub simpleLoop() Dim newVar As Integer, i As Integer For i = 1 To 4 newVar = newVar + 1 Next i End Sub -what value is stored in new Var

4

Cell A1 contains the number 10 and cell A2 contains the number 20. If you were to select both cells A1 and A2, and then use the autofill feature (clicking the green fill handle and dragging down) to fill additional cells, what would be the value of cell A5?

50

Option Explicit Sub calculateValue() Dim a As Integer, b As Integer, c As Integer a = 6 b = 2 c = a / b c = c * b MsgBox c End Sub -what will be displayed in the message box

6

Option Explicit Sub newCode() Dim a As Single, b As Single, c As Single a = 18 b =3 c = divideValues(a, b) MsgBox c End Sub Function divideValues(a As Single, b As Single) As Single divideValues = a /b End Function -what will be displayed in the message box

6

Option Explicit Sub squareInteger() Dim i As Integer Dim squaredValues (1 To 10) As Integer For i = 1 To 10 squaredValues(i) = i ^ 2 Next i MsgBox squaredValues(8) End Sub -what will be displayed in the message box

64

Cell A1 contains the number 0 and cell A2 contains the number 2. If you were to select both cells A1 and A2, and then use the autofill feature (clicking the green fill handle and dragging down) to fill additional cells, what would be the value of cell A5:

8

Option Explicit Sub dataCalculation() Dim myVar As Single myVar = 3 Call calculate1(myVar) myVar = myVar + 2 End Sub Sub calculate1(myVar As Single) myVar = myVar * 2 End Sub -what value will be stored in myVar

8

OPtion Explicit Sub analyzeData() Dim var1 As Integer Dim var2 As Integer var1 = 3 var2 = 4 If var1 = 2 Then Call process1(var1, var2) Else Call process2(var1, var2) End If MsgBox var2 End Sub Sub process1(var1 As Integer, var2 As Integer) var2 = var1 End Sub Sub process2(var1 As Integer, var2 As Integer) var2 = var1 ^ 2 End Sub -what value will be displayed in the message box

9

Option Explicit Sub doLoopExample() Dim num As Integer num = 3 Do While num <= 6 num = num + 3 Loop End Sub -what value will be stored in num

9

Option Explicit Sub setValueForC() Dim a As Single, b As Single, c As Single a = 3 b = 12 If a <= b / a Then c = a ^ 2 Else c = 1 End If End Sub

9

How many different elements can be stored in the array declared using the following expression? In other words, how many subscripts will the array named "location" have? Dim location(8) As Single

9 -starts from 0

Cell A1 contains the number 10, cell A2 contains the number 30, and cell A3 contains the number 50. If you were to select cells A1, A2, and A3, and then use the autofill feature (clicking the green fill handle and dragging down) to fill additional cells, what would be the value of cell A5?

90

Cell C3 contains the formula =$F$1*C1. If this cell was copied into cell D3, what would be the formula in cell D3?

=$F$1 * D1

How should this formula be implemented in Excel? The value for x is stored in cell A1. y = 2x+3e^x

=(2 * A1) + (3 *EXP(A1))

The figure below is a screenshot from Excel that gives the position of the Space Shuttle (column B) versus time after liftoff (column A). What formula will calculate the average speed (in m/s) of the Space Shuttle between 20 and 40 seconds? 1 A B 2 time[s] position[m] 3 0 0 4 20 1,244 5 40 5,377 6 60 11,617 7 80 19,872 8 100 31,412

=(B5-B4)/(A5-A4)

ow should this formula be implemented in Excel? The value for x is stored in cell A1. y = 3x^3−sin(2x)

=3*A1^3-sin(2*A1)

Variables can be passed between subs either by reference or by value. What is the difference between passing a variable by reference or value?

A variable passed by value will not be overwritten in the main sub when the program returns from the called sub.

What does Option Explicit mean in VBA?

All variables must be declared.

Excel uses letters and numbers to reference (or identify) cells. For the cell B5 which of the following options is correct?

B references the column and 5 references the row

Cell A3 contains the formula =A1*A2. If this formula was copied into cell B3, what would be the formula in cell B3?

B1*B2

Cell D3 contains the formula =C3/$F$1. If this formula was copied into cell D4, what would be the formula in cell D4?

C4/$F$1

Which option is a cell reference to the cell in column D, row 16?

D16

What does the following line of code mean? Dim x As Integer

Declares x as a variable that can represent both positive and negative whole numbers (including zero)

What does the following line of code mean? Dim x As Single

Declares x as a variable that can store a number, including decimal values

Numerical integration is equivalent to:

Finding the approximate area under a curve

Option Explicit Sub createLabel() Dim a As String, b As String, c As String a = "The number of weeks left in the semester is: " b = 7 c = a & b MsgBox c End Sub -what will be displayed in the message box

The number of weeks left in the semester is: 7

A numerical derivative can be thought of graphically as:

The slope between two data points

Linear interpolation relies on which of the following assumptions?

There is a linear relationship between two data points

Matrices A and B are given below. What is the matrix product of A × B? A=[1 4;2 3] B=[5 6;2 2]

[13 14;16 18]

Matrices A and B are given below. What is the matrix product of A × B? A=[1 6;2 3] B=[5;2]

[17;16]

You are trying to use Goal Seek to find the roots (where y = 0) of the equation y = 2x^4-x-25. Goal Seek fails to converge to a solution. You have already plotted the equation and are sure roots exist. What can you do in this situation? a. Try a different initial guess for x b. Use the Solver command instead; it uses a different algorithm and may work c. Re-run Goal Seek again and again and again with the same initial values - it might work eventually

a and b

all formulas in a cell must start with what?

an equals sign

Which of the following formulas cannot be used to correctly convert a value in cell A1 to radians? The value in cell A1 is in degrees: a. =A1*PI()/180 b. =A1/PI() c. =RADIANS(A1)

b

Which of the following formulas will correctly calculate the value for y? The value for x is stored in cell A1. Choose the best, most complete answer. y = 3/4x a) =3/4/A1 b) =3/(4*A1) c) =3/(A1*4)

b and c

For the following two lines of VBA code, Dim a As Single Dim b As Double what is the main difference between variables a and b?

b can hold a greater range of numbers than a

which of the following are not correct: a. =COS(RADIANS(30)) b. =COS(30) c. =COS(30*PI()/180) and why?

b is wrong because whatever is inside the parenthesis is interpreted as degrees

Which of the following statements creates a constant value for local gravitational acceleration (g)? If multiple options are valid, choose the best option. a. Const g As Single = 9.81 m/s b. Const g As Single = 9.81 c. Const g As Integer = 9.81 d. Dim g As Single = 9.81

b. Const g As Single = 9.81

Which of the following statements can be used to get a value from cell A3 and store it in a variable named gamma? Please read all of the options and choose the most complete answer. a. gamma = Cells(3,1) b. gamma = Range("A3").Value c. All of the other options are correct. d. gamma = Cells(3,1).Value e. gamma = Cells(3, "A").Value

c all of the options are correct

Which value for the variable d will make the following statement true? d < 5 OR d = 13 a. 12 b. 5 c. 2

c. 2

Which value for the variable c will make the following statement true? c >= 3 AND c <> 7 a. 7 b. 2 c. 4

c. 4

You are writing a program to calculate the concentration of a solution over time and need the user to display the final concentration on a spreadsheet. What is the correct syntax for displaying the value of the concentration in cell D1? a. Cells(1,4).Value =finalConcentration b. finalConcentration = Cells(1,4).Value c. Cells(4,1).Value = finalConcentration d. D1 = display(finalConcentration)

c. Cells(4,1).Value =finalConcentration

Which of the following expressions is equivalent to: timeValue = Range("B10").Value a. timeValue = cells(B, 10).Value b. None of the other options. c. timeValue = cells(10, 2).Value d. timeValue = cells(2, 10).Value

c. timeValue = cells(10,2).Value

Which of the following variable declarations is not valid? studentLastNames is an array that will contain the last names of all students in a class. a. Dim studentLastNames(1 To 21) As String b. Dim studentLastNames(22) As String c. All of the other options are valid. d. Dim studentLastNames(-15) As String

d. Dim studentLastNames(-15) As String -can't have negative values of arrays

Clicking on a blank cell and typing a single quotation mark (') indicates which of the following to Excel?

everything following the single quote is interpreted as text

The Excel function MMULT (if properly set up) can be used to:

multiply matrices


Related study sets

Principles of Insurance and General Insurance

View Set

Section 9: Purchase and Sale Agreements - quiz

View Set