In excels VBA Output all results to a spreadsheet. sure not to overwrite values.
ID: 3742449 • Letter: I
Question
In excels VBA
Output all results to a spreadsheet. sure not to overwrite values. Echo any input not taken from the spreadsheet. Be Use Option Explicit and Type all variables. preadsheet and your programs. All 4 subs may be placed in one file. : The first 4 terms of a certain series are of the form 3! 5! 7! 9! vx0.8, evaluate the series. Hard-wire x. Simply multiply out the factorials. a. By trial and error multiplication, what is the largest factorial that can be computed as a long?rror multiplication, what is the largest factorial that can be computed as a 1 b. Compute 12/5 as an integer and a long, and evaluate 12 mod 5. Find the arctangent of 1.5 in degrees.. c. d. Compute e23 3. The following explicit approximation to the fiction factor, f, in turbulent pipe flow is due to Zigrang and Sylvester 4.0log10 [k3/D-502 * log10 (k ks/D 13 Re ) + 3.7 Re 3.7 Here Re is the Reynolds number, ks the roughness, and D the pipe diameter. Note logiox)- 0.43429*In(x) Write a VBA program to input the Reynolds number and the roughness factor/diameter ratio. Then evaluate for Re-900,000 and ks /D = 0.04. 4. The number of heat transfer units, NTU, in a parallel flow heat exchanger is given by NTU -ln(1-P*(1+Cr)] = 1+Cr 0.531 and P = 0.345 Compute NTU if CrExplanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only first question.
Ques 1.
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text.RegularExpressions
Namespace Rextester
Public Module Program
Public Function fact(ByVal n As Integer) As Integer
Dim ans As Integer = 1
Dim i As Integer
' traverse from 1 to n to calculate n!
For i = 1 To n
ans = ans * i
Next i
Return ans
End Function
Public Function calculateSin(ByVal x As Double) As Double
Dim ans As Double = 1
Dim i As Integer
For i = 1 To 4
' CDbl() converts to Double data type
Dim temp As Double = CDbl(x ^ ( 2 * i + 1 )) / CDbl(fact( 2 * i + 1 ))
x = i Mod 2
If x <> 0 Then
temp = -temp
End If
ans = ans + temp
Next i
Return ans
End Function
Public Sub Main(args() As string)
'Your code goes here
Console.WriteLine(calculateSin(0))
End Sub
End Module
End Namespace