This code defines variables to store the number of copies and pricing for different quantity tiers, then uses conditionals to calculate the price per copy and total price based on the number of copies entered. It sets the copy and total prices based on whether the number of copies is less than or equal to 499, between 500-749, 750-999, or greater than or equal to 1000.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
87 views
Exercise 3
This code defines variables to store the number of copies and pricing for different quantity tiers, then uses conditionals to calculate the price per copy and total price based on the number of copies entered. It sets the copy and total prices based on whether the number of copies is less than or equal to 499, between 500-749, 750-999, or greater than or equal to 1000.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Public Class Form1
Dim copy1 As Decimal
Dim copy2 As Decimal Dim copy3 As Decimal Dim copy4 As Decimal Dim numberofcopies As Decimal Private Sub Price_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Price.Click numberofcopies = copies.Text copy1 = 0.3 copy2 = 0.28 copy3 = 0.27 copy4 = 0.25 If numberofcopies <= 499 Then copyprice.Text = copy1 totalprice.Text = numberofcopies * copy1 ElseIf numberofcopies <= 749 Then copyprice.Text = copy2 totalprice.Text = numberofcopies * copy2 ElseIf numberofcopies <= 999 Then copyprice.Text = copy3 totalprice.Text = numberofcopies * copy3 ElseIf numberofcopies >= 1000 Then copyprice.Text = copy4 totalprice.Text = numberofcopies * copy4 End If End Sub End Class