Tag » Visual Basic

The process of using a file: -

The process of using a file: – A file is used to input as well as output data and show that it is also called data file. 880 kata lagi

Visual Basic

Data file: -

Data file: – Visual basic provide facility to handle data file for the application. The data file is separate from the application. When user call data file for application, it links with the proper application to manipulate the data. 201 kata lagi

Visual Basic

Roz Kelly: “How I deal with my mum guilt”

{“contentType”:”NEWS_STORY”,”id”:{“value”:”6644e2fd94425474a64a0ad57560eead”,”link”:”http:\/\/api.newsapi.com.au\/content\/v2\/6644e2fd94425474a64a0ad57560eead”},”originId”:”BodyAndSoul-36362″,”origin”:”WORDPRESS”,”channel”:”NONE”,”title”:”Roz Kelly: \u201cHow I deal with my mum guilt\u201d”,”subtitle”:”Roz Kelly: "How I deal with my mum guilt"”,”description”:”

Humour and forgetting about \u201cbouncing back\u201d helps, reckons the working mum and world traveller. 2.111 kata lagi

Mind Body

73) Design a form and write a program in visual basic for output file. The output file contains roll no, name and total marks of some student. Name of this output file is marks.dat. Append some record in same output file. Number of record can be input by the user from keyboard until he wants?

Private Sub Command1_Click()
    Dim SName As String
    Dim rn, tm As String
    Open "Marks.dat" For Append As #1
    rn = 1
    Do While rn > 0
        SName = InputBox("Enter Student Name", "String")
        rn = InputBox("Enter Roll No", "Integer")
        tm = InputBox("Enter Total Marks", "Integer")
        If rn = 0 Then
            Close #1
            End
        End If
    Write #1, rn, SName, tm
    Loop
End Sub
Visual Basic

72) Design a form and write a program in visual basic to input roll no and total marks of 10 students from keyboard. Write roll no and total marks of those students to pass.dat file which total marks is greater than or equal to 300. Write roll no and total marks of remaining student to fail.dat file?

Private Sub Command1_Click()
    Dim i, rn, tm As Integer
    Open "Pass.dat" For Output As #1
    Open "Fail.dat" For Output As #2
    For i = 1 To 10
        rn = InputBox("Enter Roll No ", "Integer")
        tm = InputBox("Enter Total Marks ", "Integer")
        If tm >= 300 Then
            Write #1, rn, tm
        Else
            Write #2, rn, tm
        End If
    Next i
    Close #1, #2
End Sub
Visual Basic

71) Design a form and write a program in visual basic to input roll no and name and marks of three subject from keyboard. Write roll no and name of only those students to an output file which marks of each subject is greater than equal to 35. Name of output file is student.txt. Also, count and print how many students which roll no and name not write to output file. Total number of student are 10?

Private Sub Command1_Click()
    Dim SName As String
    Dim rn, i, c, s1, s2, s3 As Integer
    Open "Student.txt" For Output As #1
    c = 0
    For i = 1 To 10
        SName = InputBox("Enter Student Name ", "String")
        rn = InputBox("Enter Roll No ", "Integer")
        s1 = InputBox("Enter 1st Subject Marks ", "Integer")
        s2 = InputBox("Enter 2nd Subject Marks", "Integer")
        s3 = InputBox("Enter 3rd Subject Marks", "Integer")
        If s1 >= 35 And s2 >= 35 And s3 >= 35 Then
            Write #1, rn, SName
            c = c + 1
        End If
    Next i
    Close #1
    Print "Student Not Write A File ", 10 - c
End Sub
Visual Basic

70) Design a form and write a program in visual basic to input name and roll no of 5 students from keyboard and write it to an output file named as student.dat?

Private Sub Command1_Click()
    Dim SName  As String
    Dim rn, i As Integer
    Open "Student.dat" For Output As #1
    For i = 1 To 5
        SName = InputBox("Enter Student Name", "String")
        rn = InputBox("Enter Roll No", "Integer")
        Write #1, SName, rn
    Next i
    Close #1
End Sub
Visual Basic