0% found this document useful (0 votes)
98 views5 pages

Quiz7, UAS - Looping-Hilman Ashari 19306039

The document contains code for a visual basic application that uses looping structures like For, While, and Do to display values in a list box. It also contains code for a form that allows entering and displaying student data in textboxes and saving it to a SQL Server database table called Master_mahasiswa with fields for NPM, name, address, phone, and major.

Uploaded by

Hilaman ashari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
98 views5 pages

Quiz7, UAS - Looping-Hilman Ashari 19306039

The document contains code for a visual basic application that uses looping structures like For, While, and Do to display values in a list box. It also contains code for a form that allows entering and displaying student data in textboxes and saving it to a SQL Server database table called Master_mahasiswa with fields for NPM, name, address, phone, and major.

Uploaded by

Hilaman ashari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 5

Nama :hilman asahri

Kelas :KMA-R31/19
Npm:19306039
Uts vb
Tampilan sofware
Tolbox+properties

From

-starposition,center the screen

-text ,latihan looping

Label1

-text,Nilai awal

Label 2

-text,nilai akhir

Textbox 1

-Name,txtawal

Textbox 2

-Name,txtakhir

Button 1

-Text,For-Next

-Name,btnFor

Button 2

-text, while –Edwhile

-Name,btnwhile
Button 3

-Text,Do- while oop

-Name,btnDo

Button4

-Text,clear

-Name,btnclear

List box

-Name,lathasil

Code
Public Class Form1

Private Sub BtnFor_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles BtnFor.Click
LatHasil.Items.Clear()
Dim x As Integer
Dim y As Integer
Dim z As Integer
x = TxtAwal.Text
y = TxtAkhir.Text
For z = x To y
LatHasil.Items.Add(z)

Next z
End Sub

Private Sub BtnWhile_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles BtnWhile.Click
Dim x As Integer
Dim y As Integer
x = TxtAwal.Text
y = TxtAkhir.Text
While (x <= y)
LatHasil.Items.Add(x)
x += 1

End While
End Sub

Private Sub BtnDo_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles BtnDo.Click
Dim x As Integer
Dim y As Integer
x = TxtAwal.Text
y = TxtAkhir.Text
Do Until x > y
LatHasil.Items.Add(x)
x += 1

Loop
End Sub
Private Sub Btnclear_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Btnclear.Click
LatHasil.Items.Clear()

End Sub
End Class

UAS Praktikum visual basic dengan sql server 2008


Sofware yang di buat adalah master mahasiswa

Ini code nya


Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim a, b, c, d, f As String
a = "Masukan NPM"
b = "Masukan Nama"
c = "Masukan Alamat"
d = "Masukan Telepon"

TxtNpm.Text = a
TxtNama.Text = b
TxtAlamat.Text = c
TxtTelepon.Text = d

End Sub
Private Sub Btclear_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Btclear.Click
Me.Close()
End Sub
End Class

Create database Master_mahasiswa


Create Table Master_mahasiswa
NPM char(10)
Nama_mahasiswa varchar(50)
Alamat Varchar(50)
Telepon char(10)
Jurusan (30)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy