J=1 J=J+1 ( J2<=n) case' used with strings in pg assignment for after next week -- reading data from a file p98-99. object called stream reader. inputs that bring in bits is called Binary' ..n string' is represented with bits...another kind of input is sequential'. Stream means a sequential character.Comma Separated Values (CSV) Dim S as String S= r.readline () r.close 3.3 pg 98 -- 103(Text) 96 8.1 8.2 go through pg 102 pg 99 pg 425 dim readerVal as IO stream reader dim sr as IO stream reader(globally) sub dim filespace as string sr = IO.file.opentext(filespace) sub dim line as string line = sr.readline() x = cdbl(line) 7.1 pg 316/36 7.2 pg/23 7.4 368-9/29,31 add in calculator project add sum file tab open file read it from compute total,count avg fucntion notEOF as boolean Friday,Nov 12 2010 Modularity - 10 % readability - 10 % dim a,b,c,d,e as dim answer as integer 'INPUT call getAll(a,b,c,d,e)-- a = get a() b = get b() and so on PROCESS answer = addemup(a,b,c,d,e) function addemup byval (a,b,c,d,e) dim result as integer result = a+b+b+c.... pass by value for a = b to a stop -1 total = b + q pass by refrence pass by copy in/copy out pass by name return result end function sub btnfix2by val.........handles btn fix2.click '***** check if a, b in order fix then its not dim a ,b 'INPUT : a,b 'from first and second textbox call get 2 (a,b) or a= get first b = get second 'PROCES: check if a 1) line = ////.readline() c = line.split(",") id(n) = cint(c(0)) dim sr as IO.stream Reader sub get file spec() as string '???get file from return end sub sub btnopen click '///open file file spec = gert file spec () sr = IO.file,opentext(file spec) end sr.close() CST112 Project #0 Create a VB form to read numeric values from a file. Use a list box for multi-line output, as described below. (There is no input from the form.) Include the following buttons, with handlers to perform the following actions: OPEN FILE: Pop up a dialog box to input a file specification. Assume the file specification is correct, and open the file for reading. NEXT: Unless the file is at the end, read one line and convert it to a numeric value. Add the value to a running total, increase the count by one, and recompute the mean average. Then, display the output lines (in the listbox) similar to the following: The next value is 42.75 It is greater than the average. The count is now 10 The total is 386.0 The average is 38.6 If the value is within 1% of the average, say so instead. CLEAR: Clear the output area (listbox). function is odd(n as integer) as boolean '//// true iff n is odd return (n mod 2> 0) Public Class Form1 '******** OUTPUT METHODS ******* Sub say(ByVal s As String) '**** Output a string to the paystub. Me.paystub.Items.Add(s) 'Display the string s in listbox. End Sub Sub saywhat(ByVal s As String, ByVal r As Double) '**** Output a string and a value to the paystub. Me.paystub.Items.Add(s & " " & Format(r)) 'Display string s & r in listbox. End Sub Dim ID As Integer '**Greater than zero. Dim Last As String Dim First As String Dim Pay As Double Dim code As Integer Dim hrsWorked As Integer Function grosspay byval( a, b) result = a * b If End Function End Class