Tuesday, March 13, 2012
Option Explicit
' write a UDF to convert a word to pig latin
Function PigLatin(T as String) As String
' 1. extract first letter
Dim firstLetter As String
firstLetter = Left(T, 1)
if firstLetter = "A" Or firstLetter = "E" Or firstLetter = "I" Or firstLetter = "O" Or firstLetter = "U" Then
PigLatin = T & "way"
else
PigLatin = Mid(T, 2, 1000) & firstLetter & "ay"
end if
End Function
latin
1. extract first letter =LEFT(G2)
2. is it a vowel? =OR(G3="A", G3="E", G3="I", G3="O", G3="U")
3. calculation for vowel
3a. Take word, add 'way' =G2 & "way"
4. calculation for consonant
4a. Rest of word, besides first =MID(G2, 2, 1000)
4b. What was that first letter? =LOWER(G3)
4c. Concatenate =G8 & G9
4d. Add 'ay' =G10 & "ay"
5. Select vowel or consonant path =IF(G4, G6, G11)
ch 11: financial functions
time value of money
present value vs. future value
PV, FV
related by RATE
FV = PV + PV * RATE
FV = PV * ( 1 + RATE )
FV2 = PV * ( 1 + RATE ) * (1 + RATE)
FV3 = PV * ( 1 + RATE ) * (1 + RATE) * (1 + RATE)
for year NPER
FV = PV * (1 + RATE) ^ NPER
nominal rate, APR (annual percentage rate)
7%
periodic effective rate. for a given compunding period (say, a month), what is the rate?
APR / numperiodsperyear
1. What function should I use?
2. What are my parameters?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment