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

Problem Description Problem You are a software engineer and you have been approa

ID: 3804810 • Letter: P

Question

Problem Description Problem You are a software engineer and you have been approached by a client who needs a code to calculate both settling velocity of a spherical particle and parachutist's velocity. According Stoke's Law, it is known that the settling velocity of a spherical particle in a beaker containing fluid can be estimated as: 18 u where v is the downward velocity of the particle [cm/s], g is the acceleration due to gravity [a 980 cm/s or is the density of the fluid 1.0 cm for fresh the density of the particle 2,65 g/cm for a mineral particle], u is the dynamic viscosity of the fluid 0.013 g m s) for fresh water], and the diameter of the beaker [specified by the user, in cm]. Also, according to the laws of physics, i is known that if a jumps from a platform, the is pulled, the jumper's velocity can be computed with the function: gm (calm De v(t) va where v(t) is the downward velocity [m/sl, vo is the initial downward velocity 0 m/sltis the time ts, g is the gravitational constant 9.8 m/s2], m is the jumper's mass rkgl, and c is a proportionality constant called the drag coefficient 12.5 kg/sl, which parameterizes air resistance Tasks 1. write a button triggered vBA code which allows the user to specify the type of computations they want. Then, based on their choice, your code should CALL the appropriate FUNCTION procedure for settling velocity or the SUB procedure for parachutist's velocity, perform the computations, and display the appropriate answer. 3. Your code should be able to display an error message in case the user specifies a computation other than settling velocity or parachutist's velocity. NOTE: For particle settling velocity, the user should input the diameter of the beaker [in cm] and get the velocity lems1. The input data for parachutist's velocity computations should be mass of the user, m [kgl, and time t [sl while the output is the velocity,

Explanation / Answer

getResult_Click() is called on button click in Excel::

Below is the code for above functionality

Public Sub getResult_Click()
Dim Length As Double
Dim Width As Double
Dim Result As Double
Dim InputData As String
Dim EqualV As Integer
Dim EqualS As Integer
InputData = InputBox("velocity or stoke law ", "Computation Type")
EqualV = StrComp(InputData, "velocity")
EqualS = StrComp(InputData, "stoke law")
If EqualS <> 0 And EqualV <> 0 Then
MsgBox ("Enter Correct Computation to be performed")
End If
If EqualS = 0 Then
Call getStokeLaw
End If
If EqualV = 0 Then
Call getVelocity
End If
End Sub


Public Sub getStokeLaw()
Dim g As Double
Dim phof As Double
Dim phop As Double
Dim mew As Double
Dim d As Double
Dim Res As Double
g = InputBox("Enter g's value", "Stoke Law")
phof = InputBox("Enter fluid density", "Stoke Law")
phop = InputBox("Enter particle density", "Stoke Law")
mew = InputBox("Enter dynamic viscosity", "Stoke Law")
d = InputBox("Enter diameter", "Stoke Law")
Res = (g / 18) * ((phop - phof) / mew) * (d * d)
MsgBox ("Velocity value = " & Res)
End Sub

Public Sub getVelocity()
Dim g As Double
Dim cd As Double
Dim t As Double
Dim m As Double
Dim vo As Double
Dim Res1 As Double
Dim Res2 As Double
Dim e As Double
e = 2.718281828
g = InputBox("Enter g value", "Velocity Calculation")
cd = InputBox("Enter drag coefficient", "Velocity Calculation")
t = InputBox("Enter time value", "Velocity Calculation")
m = InputBox("Enter mass value", "Velocity Calculation")
vo = InputBox("Enter initial velocity ", "Velocity Calculation")
Res1 = -1 * (cd / m) * t
Res2 = (vo * (e ^ Res1)) + (((g * m) / cd) * (1 - (e ^ Res1)))
MsgBox ("Velocity value = " & Res2)
End Sub

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