This assignment will introduce the Visual Basic procedures and functions while i
ID: 3736994 • Letter: T
Question
This assignment will introduce the Visual Basic procedures and functions while incorporating looping and class level variables. Create a new project by doing the following: a. Select New Project from the File menu or clicking on the New Project button on the toolbar (it is the first button on the toolbar). b. If you are prompted to Save or Discard the current project, choose Discard. c. In the New Project window, from the left hand column, select the option for Visual Basic d. In the New Project window, from the middle column, select the option for Windows Forms Application e. At the bottom of the New Project window, change the name of the project from WindowsApplicationI to VBLab6 At the bottom of the New Project window, change the Location of where the files will be saved by clicking on the Browse button and selecting the drive letter containing your storage device and then the CSC106Visual Basic folder within your storage device. (You must save the work in the CSC106Visual Basic folder.) f. g. At the bottom of the New Project window, change the Solution Name from h. At the bottom of the New Project window, leave the option to Create Directory For Solution still The following form should be built in Visual Basic: Windows.Applications1 to VBLab6 checked At the bottom of the New Project window, click on the Save button Student Registration Report Student Name Credit Under Part Or Tuition General Tech Total Tuition Name Hours Or Grad Full Cost Fee Fee Fees& Fees m.m ?2.?2 Und Full ?.2? ?.2? ?.? .2? 2. 2.?? 2. 2.?? Joe Jackson 14 Eddie Crane 9 Und? 2.7? 2.? Susan Spiel 18 Grad ? Fred Mertz Jack Tripper Nicole Kidder 12 10 17 Grad ? Grad Part Und ?2.2? 2.72 .?? ?.2 .72 ??.?? Total number of part time students: ? Total number of full time students: ? Total number of undergrad students: ? Total number of graduate students: ? Total number of students Total tuition costs: Total general fees: Total technology fees: Total fees combined costs: Total of tuition and fees combined costs Calculate Costs Clear ExitExplanation / Answer
Public Class Tution_Fee
Private Sub Tution_Fee_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Create two inputs and a button to use as the accept and cancel buttons.
Dim button1 As New Button()
' Set the text of button1 to "OK".
button1.Text = "SUBMIT"
' Set the position of the button on the form. You can drag the button on your form instead of hardcoding
' Set the caption bar text of the form.
Me.Text = "Student Details"
Me.FormBorderStyle = FormBorderStyle.FixedDialog
' Set the accept button of the form to button1.
Me.AcceptButton = button1
' Set window width and height
Me.Height = 300
Me.Width = 560
' Add button1 to the form.
Me.Controls.Add(button1)
End Sub
End Class
Here, we have simply added a button.
You need to add 3 inputs to your form. For this instead of typing a code, use the user interfaces available in the VB and drag and drop what you want.
You need to display 3 text labels and palce to insert text:
Simply Add (drag and drop) a label and a textbox to the form. Change the label's text to "Student Name"
Drag 1 more label and a textbox to the form. Change the label's text to "Credit Hours"
Drag 1 more label and a textbox to the form. Change the label's text to "Graduation Level"
Simply perform the following arithmetic on the input data:
Dim ugfee As Decimal
Dim gradfee As Decimal
Private Sub button1_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click
If textbox2.text = "u" Then
ugfee = textbox1 * 200
Form2.Show()
Else If
textbox2.text = "U" Then
ugfee = textbox1 * 200
Form2.Show()
Else If
textbox2.text = "G" Then
ugfee = textbox1 * 100
Form2.Show()
textbox2.text = "g" Then
ugfee = textbox1 * 100
Form2.Show()
End If
End Sub
We have fetched the result credit hours and multiplied with 100 and 200 based on graduation or undergraduation.
Create another form : Form2 where the 'ugfee' variable can be displayed
If you have already stored your data in a table you can use following code on click of the button to fetch result from the tables
Add the following code to the button click event code of the button we already added:
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
ds = New DataSet
tables = ds.Tables
Dim da As New OleDbDataAdapter("Select * from table_name where _name = '" & TextBox1.Text & "'", con)
If da.Fill(ds, "table_name ") Then
Dim view As DataView = ds.Tables(0).DefaultView
source1.DataSource = view
DataGridView1.DataSource = view
Else
MsgBox("NO DATA!")
End If
What this code will do is, it will select the name of student matching the input from the table where you have stored your data.
You dont have to hardcode anything in VB. Here you have got interface available that stores entire list of available GUIs. Please drag and drop anything you want and simply change the properties of the object you use, from the name to on click whatever you want can be changed in that way
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.