Beruflich Dokumente
Kultur Dokumente
1.1
Dim Count As Integer
Dim Name, Email, LineString As String
For Count = 1 To 3
Name = Console.ReadLine
Email = Console.ReadLine
LineString = Name + "#" + Email
StudentData(Count) = LineString
Next
For Count = 1 To 3
StudentData(Count) = ""
Next
For Count = 1 To 3
Name = Console.ReadLine
Email = Console.ReadLine
LineString = Name + "#" + Email
StudentData(Count) = LineString
Next
For Count = 1 To 3
StudentData(Count) = ""
Next
For Count = 1 To 3
Name = Console.ReadLine
Email = Console.ReadLine
LineString = Name + "#" + Email
StudentData(Count) = LineString
Next
Do
LengthName = Len(SearchItem)
If SearchItem = Left(StudentData(Count), LengthName) Then
LengthString = Len(StudentData(Count))
Found = True
Email = Right(StudentData(Count), LengthString - LengthName - 1)
Console.WriteLine(Email)
Else Count = Count + 1
End If
Loop Until Found = True Or Count > 3
If Found = False Then
Console.WriteLine("Search term not found")
End If
Console.ReadKey()
End Sub
End Module
Module Module1
1.4
Sub Main()
Dim StudentData(10) As String
Dim Count As Integer
Dim Name, Email, LineString As String
For Count = 1 To 3
StudentData(Count) = ""
Next
For Count = 1 To 3
Name = Console.ReadLine
Email = Console.ReadLine
LineString = Name + "#" + Email
StudentData(Count) = LineString
Next
Do
LengthName = Len(SearchItem)
If SearchItem = Left(StudentData(Count), LengthName) Then
Console.WriteLine(StudentData(Count))
Count = Count + 1
End If
Loop Until Count > 3
Console.ReadKey()
End Sub
End Module
Module Module1
1.5
Sub Main()
Dim StudentData(10, 4) As String
Dim Count, x As Integer
Dim Name, Email, DateOfBirth, ID As String
For Count = 1 To 10
For x = 1 To 4
StudentData(Count, x) = ""
Next
Next
For Count = 1 To 3
Name = Console.ReadLine
Email = Console.ReadLine
DateOfBirth = Console.ReadLine
ID = Console.ReadLine
StudentData(Count, 1) = Name
StudentData(Count, 2) = Email
StudentData(Count, 3) = DateOfBirth
StudentData(Count, 4) = ID
Next
Do
LengthName = Len(SearchItem)
If SearchItem = Left(StudentData(Count, 1), LengthName) Then
Console.WriteLine(StudentData(Count, 1))
Console.WriteLine(StudentData(Count, 2))
Console.WriteLine(StudentData(Count, 3))
Console.WriteLine(StudentData(Count, 4))
End If
Count = Count + 1
Loop Until Count > 3
Console.ReadKey()
End Sub
End Module
Module Module1
2.1
Sub Main()
FileOpen(1, "D:\CS.txt", OpenMode.Output)
Dim ID, Email, LineString As String
Dim count As Integer
For count = 1 To 2
ID = Console.ReadLine
Email = Console.ReadLine
LineString = ID + "#" + Email
PrintLine(1, LineString)
Next
End Sub
End Module
Module Module1
2.2
Sub Main()
FileOpen(1, "D:\CS.txt", OpenMode.Input)
Dim SearchItem, Email, LineString As String
Dim count As Integer
Dim found As Boolean
SearchItem = Console.ReadLine
count = 1
found = False
Do
LineString = LineInput(1)
If SearchItem = Left(LineString, 6) Then
Email = Right(LineString, Len(LineString) - 7)
Console.WriteLine(Email)
found = True
End If
Loop Until EOF(1) Or found = True
If found = False Then
Console.WriteLine("ID not found")
End If
Console.ReadKey()
End Sub
End Module
Module Module1
2.3
Sub Main()
FileOpen(1, "D:\CS.txt", OpenMode.Input)
Dim SearchItem, LineString As String
Dim count, LengthSearchID As Integer
SearchItem = Console.ReadLine
count = 1
Do
LineString = LineInput(1)
LengthSearchID = Len(SearchItem)
If SearchItem = Left(LineString, LengthSearchID) Then
Console.WriteLine(Left(LineString, 6))
End If
Loop Until EOF(1)
Console.ReadKey()
End Sub
End Module
Sub Main()
2.5?
FileOpen(1, "D:\CS2.txt", OpenMode.Output)
Dim ID, Email, Address, Tutor As String
PrintLine(1, ID)
PrintLine(1, Email)
PrintLine(1, Address)
PrintLine(1, Tutor)
FileClose(1)
End Sub
Sub Main()
2.5?
FileOpen(1, "D:\cs pt 2.txt", OpenMode.Input)
FileOpen(2, "D:\cs new.txt", OpenMode.Output)
Dim ID, Email, LineString As String
Dim LengthString As Integer
Do
LineString = LineInput(1)
LengthString = Len(LineString)
ID = Left(LineString, 6)
Email = Right(LineString, LengthString - 7)
PrintLine(2, ID)
PrintLine(2, Email)