This code defines a form with a button click event handler that calculates printing costs based on the number of copies entered in a text box. It determines the cost per copy based on quantity breakpoints, multiplies this by the number of copies, and displays the results in two labels on the form.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
54 views1 page
Exercise 3
This code defines a form with a button click event handler that calculates printing costs based on the number of copies entered in a text box. It determines the cost per copy based on quantity breakpoints, multiplies this by the number of copies, and displays the results in two labels on the form.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Exercise 3
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Copies As Integer Copies = TextBox1.Text If TextBox1.Text < 500 Then Label1.Text = 0.3 Label2.Text = Copies * 0.3 ElseIf TextBox1.Text < 750 Then Label1.Text = 0.28 Label2.Text = Copies * 0.28 ElseIf TextBox1.Text < 1000 Then Label1.Text = 0.27 Label2.Text = Copies * 0.27 ElseIf TextBox1.Text >= 1000 Then Label1.Text = 0.25 Label2.Text = Copies * 0.25 End If End Sub End Class