I have an upcoming exam and I don't have access to my professor and I have questions that the book is not clarifying for me. The book that the class is using is Murach's Visual Basic 2008.
iI will list the questions will by numbers. I understand that there are alot of questions here but I really need a good grade on this exam and these are the areas that I am still unsure of. Some of the questions, I have tried to answer and I posted a comment in (), it my guess is correct could you annotate so. If not could you help me get on base.
I am taking the exam tomorrow at 11. I have been buried in this book for a couple of days now and I need help. I am using this site as a last resort. I figured individuals on here are much more proficient than myself so I mine as well ask the experts.
I want to thank anyone in advance that is willing to answer any of these questions for me. God Bless and Happy Veterans Day. I myself am an "Iraq Veteran" in 2003.
13. Code that uses the IndexOf method (THE PROFESSOR POSTED THE COMMENTS AT THE END OF EACH STATEMENT, I DONT UNDERSTAND WHAT HE IS REFERRING TO THOUGH)
Dim companyName As String = "Mike Murach and Associates"
Dim index1 As Integer = companyName.IndexOf(" ") ' 4 (IS THIS NOTING WHERE THE FIRST SPACE IS
AND REFERERENCING IT'S POINT AS INDEX1?)
Dim index2 As Integer = companyName.IndexOf("Inc.") ' -1 (THIS ISN'T IN THE COMPANY NAME AT THIS
POINT SO I AM CONFUSED?)
Dim index3 As Integer = companyName.LastIndexOf(" ") ' 15 (THIS IS REFERENCING THE THIRD SPACE
AFTER THE AND?)
Dim index4 As Integer = companyName.IndexOf(a) ?? (THIS IS REFERENCING THE FIRST LETTER A?
WHAT ANNOTATES IF ITS NOT THE FIRST
LETTER A, AND IS REFERING TO THE FIRST
WORD WITH FIRST LETTER A? )
Dim index5 As Integer = companyName.LastIndexOf(a) ?? (BASED ON THE FIRST REFERENCE I AM
GUESSING THAT IT IS REFERRING TO THE
LAST WORD WITH THE FIRST LETTER A IN
Code that uses the Remove, Insert, and Replace methods
companyName = companyName.Remove(0, index1 + 1) ?? (DOES THIS SAY REMOVE THE FIRST
= companyName.Insert(companyName.Length, ", Inc.") ?? (DOES THIS SAY INSERT "Inc." AT THE
END OF THE COMPANY NAME?)
= companyName.Replace("and", "And")
' Murach And Associates, Inc. (THIS CODE IS JUST SAYING REPLACE
ONE DESIGNATED WORD FOR
companyName = companyName.Insert(companyName.IndexOf(and), JJ) ?? (THIS CODE IS SAYING
INSERT "JJ" IN THE
PLACE OF "and"?)
14. Code that copies one string to another string
Dim s1 As String = "abc"
Dim s2 As String = s1
' This creates a new string with the value "abc"
s2 = "def"
' This doesn't change the value stored in s1
15. Application Examples: (1) Code that parses a first name from a name string
Dim fullName As String = " Edward C Koop "
fullName = fullName.Trim 'fullname ??
Answer: ( "Edward C Koop"?)
Dim firstSpace As Integer = fullName.IndexOf(" ") ' 6 (FIRST SPACE?)
Dim firstName As String = ""
If firstSpace = -1 Then
firstName = fullName ?? (THIS STATEMENT COMPLETELY CONFUSES ME?)
firstName = fullName.Substring(0, firstSpace) ?? (THIS STATEMENT IS SAYING REMOVE THE FIRST