Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Main()
- Dim BookInfo() As String
- Dim PublicationDate As String
- Dim AgeOfBook As Integer
- Dim InfoLine() As String = (My.Computer.FileSystem.ReadAllText("C:\Users\tfqsy\OneDrive\Desktop\Library.txt")).Split(Environment.NewLine)
- For i = 0 To InfoLine.Length - 2
- BookInfo = InfoLine(i).Split(",")
- Console.Write("Enter the publication date for book of title '" & BookInfo(0) & "' : ")
- Dim DateString As String = Console.ReadLine()
- PublicationDate = Convert.ToDateTime(DateString)
- Console.Write("Enter age of book : '" & BookInfo(0) & "' in months: ")
- Do
- AgeOfBook = Console.ReadLine()
- Loop Until AgeOfBook > 0
- InfoLine(i) = InfoLine(i) & "," &
- PublicationDate & "," &
- AgeOfBook
- Next
- FileOpen(1, "C:\Users\tfqsy\OneDrive\Desktop\LibraryRevised.txt", OpenMode.Append)
- For i = 0 To InfoLine.Length - 2
- PrintLine(1, InfoLine(i))
- Next
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement