Advertisement
nein_yards

prereleasejan20202

Jan 7th, 2020
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Module Module1
  2. Sub Main()
  3. Dim BookInfo() As String
  4. Dim PublicationDate As String
  5. Dim AgeOfBook As Integer
  6. Dim InfoLine() As String = (My.Computer.FileSystem.ReadAllText("C:\Users\tfqsy\OneDrive\Desktop\Library.txt")).Split(Environment.NewLine)
  7. For i = 0 To InfoLine.Length - 2
  8. BookInfo = InfoLine(i).Split(",")
  9. Console.Write("Enter the publication date for book of title '" & BookInfo(0) & "' : ")
  10. Dim DateString As String = Console.ReadLine()
  11. PublicationDate = Convert.ToDateTime(DateString)
  12. Console.Write("Enter age of book : '" & BookInfo(0) & "' in months: ")
  13. Do
  14. AgeOfBook = Console.ReadLine()
  15. Loop Until AgeOfBook > 0
  16. InfoLine(i) = InfoLine(i) & "," &
  17. PublicationDate & "," &
  18. AgeOfBook
  19. Next
  20. FileOpen(1, "C:\Users\tfqsy\OneDrive\Desktop\LibraryRevised.txt", OpenMode.Append)
  21. For i = 0 To InfoLine.Length - 2
  22. PrintLine(1, InfoLine(i))
  23. Next
  24. End Sub
  25. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement