daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Main()
  2.  
  3.         Task 1.1
  4.  
  5.         Dim membername As String
  6.         Dim memberidnumber As Integer
  7.  
  8.         Console.WriteLine("enter membername")
  9.         membername = Console.ReadLine
  10.  
  11.         Console.WriteLine("enter memberidnumber")
  12.         memberidnumber = Console.ReadLine
  13.  
  14.         FileOpen(1, "d:/filepractice/sRec.txt", OpenMode.Output)
  15.  
  16.         FileClose(1)
  17.  
  18.  
  19.  
  20.     End Sub
  21.  
  22. End Module
  23.  
  24.  
  25.     Sub Main()
  26.  
  27.  
  28.         Task 1.2
  29.  
  30.         Dim membername As String
  31.         Dim memberidnumber As Integer
  32.  
  33.         Console.WriteLine("enter membername")
  34.         membername = Console.ReadLine
  35.  
  36.         Console.WriteLine("enter memberidnumber")
  37.         memberidnumber = Console.ReadLine
  38.  
  39.         WriteLine(1, membername)
  40.         WriteLine(1, memberidnumber)
  41.  
  42.         FileClose(1)
  43.  
  44.     End Sub
  45.  
  46. End Module
  47.  
  48. Sub Main()
  49.  
  50.         Task 1.3
  51.         Dim membername, searchmembername As String
  52.         Dim memberidnumber As Integer
  53.         Dim isfound As Boolean
  54.         isfound = False
  55.  
  56.         Console.Write("enter membername to search for :")
  57.         searchmembername = Console.ReadLine
  58.         FileOpen(1, "d:/filepractice/sRec.txt", OpenMode.Input)
  59.  
  60.         While Not EOF(1)
  61.             Input(1, membername)
  62.             Input(1, memberidnumber)
  63.  
  64.             If membername = searchmembername Then
  65.                 isfound = True
  66.  
  67.           Console.WriteLine("member_id_number.:" & memberidnumber)
  68.             End If
  69.         End While
  70.         FileClose(1)
  71.  
  72.         If isfound = False Then Console.WriteLine("record not found")
  73.  
  74.         Console.ReadKey()
  75.  
  76.     End Sub
  77.  
  78.     End Module
  79.  
  80.  Sub Main()
  81.  
  82.         TASK 1.4
  83.  
  84.         Dim membername As String
  85.         Dim memberidnumber As Integer
  86.  
  87.         Console.WriteLine("enter membername")
  88.         membername = Console.ReadLine
  89.  
  90.         Console.WriteLine("enter memberidnumber")
  91.         memberidnumber = Console.ReadLine
  92.  
  93.         FileOpen(1, "d:/filepractice/sRec.txt", OpenMode.Append)
  94.  
  95.         FileClose(1)
  96.  
  97.     End Sub
  98.  
  99. End Module
  100.  
  101.  
  102.  
  103.     Sub Main()
  104.  
  105.         TASK 1.5
  106.  
  107.         Dim membername As String
  108.         Dim memberidnumber As Integer
  109.         Dim telno As String
  110.         Dim memsd As Date
  111.  
  112.         FileOpen(1, "d:/filepractice/sRec.txt", OpenMode.Input)
  113.         FileOpen(1, "d:/file/sRec.txt", OpenMode.Append)
  114.  
  115.         While Not EOF(1)
  116.  
  117.             Input(1, membername)
  118.             Input(1, memberidnumber)
  119.  
  120.             console.writeline("Enter telephone no for membername:", & membername)
  121.             telno = Console.ReadLine
  122.             console.writeline("Enter membership start date for membername:", & memberidnumber)
  123.             memberidnumber = Console.ReadLine
  124.  
  125.             WriteLine(2, membername)
  126.             WriteLine(2, memberidnumber)
  127.             WriteLine(2, telno)
  128.             WriteLine(2, memsd)
  129.  
  130.         End While
  131.  
  132.         FileClose(1)
  133.         FileClose(2)
  134.  
  135.         My.Computer.FileSystem.DeleteFile("d:/filepractice/sRec.txt")
  136.  
  137.  
  138.  
  139.     End Sub
  140.  
  141. End Module
RAW Paste Data
Top