Answered You can hire a professional tutor to get the answer.
Write a program, and store it in a file called String Funtions.xlsm, that does the following:
Write a program, and store it in a file called String Funtions.xlsm, that does the following:
(a) It asks the user for a word with at least 10 characters and stores it in
myWord; (b) it displays a message indicating the number of characters in the word; (c)
it displays a message showing the first four characters of the word; (d) it displays a message
showing the last six characters of the word; (e) it displays a message showing the
fifth character in the word; (f) it displays a message showing all but the first two and
last two characters in the word; and (g) it displays the word in reversed order. (Hint:
For the last part, look up Strings in the VBA library of the Object Browser.)
I wrote the code:
Option Explicit
Sub Travel_expenses()
Dim firstName As String
Dim lastName As String
Dim nMiles As Integer
Dim milesPerGallon As Single
Dim avgPrice As Currency
Dim tripCost As Currency
firstName = InputBox("Enter the first name.")
lastName = InputBox("Enter the last name.")
nMiles = InputBox("Enter the number of miles driven.")
milesPerGallon = InputBox("Enter the average miles per gallon.")
avgPrice = InputBox("Enter the average price per gallon of gasoline.")
tripCost = nMiles / milesPerGallon * avgPrice
MsgBox firstName&" "&lastName&"traveled"&nMiles&"miles,got"&milesPerGallon&"mile per gallon on average,paid"&Format(avgPrice,"$0.00) &"per gallon on average,and paid a total of", &Format(tripCost,"$0.00") &"for gas.",vbInformation,"trip info"
End Sub
But i got syntax error and Expected: end of statements in the MsgBox.
please help me