Question 3
Design the following form and the write a programme which calculates the highest number, when a
user enter two numbers, it should display the highest number. Use a function in your programme
Private Sub Button2_Click(ByVal sender As [Link], ByVal e As [Link]) Handles
[Link]
[Link]()
End Sub
Private Sub Button1_Click(ByVal sender As [Link], ByVal e As [Link]) Handles
[Link]
Dim num1 As Integer Dim num2 As Integer
[Link]([Link], num1)
[Link]([Link], num2)
If num1 > num2 Then
Dim temp As Integer temp = num1
num1 = num2
num2 = temp
End If
[Link] = "Lowest:" & [Link](num1) & [Link] & "Highest:" &
[Link](num2)
End Sub
End
Question 4
Develop a programme for “look sharp fitness centre “with one screen shoots that included bellow.
Your application should satisfy the following requirements: The programme should allow you to
enter the number of items and the price of the items using text boxes only. Please group the sub
departments with group boxes The programme must be able to calculate the extended prices, 30%
discount given to the customer, the amount due to the customer and display the answers in the text
boxes. The programme must display the total sales and number of transactions in the text boxes
only. Include the following buttons in your programme calculate, clear and exit in your
programme. The clear button must be able to clear everything in all the text boxes in the above
programme. If all the text boxes are clear the number of items textbox must be in focus If the price
is invalid it must show the user by the form of messagebox eg [Link]("Invalid price.",
"Data Error")
Public Class BookSaleForm
//Declare the constant.
Const DISCOUNT_RATE_Decimal As Decimal = 0.15D
Private Sub PrintButton_Click(ByVal sender As [Link], _ ByVal e As [Link])
Handles [Link]
//Print the form.
[Link] = [Link] [Link]()
End Sub
Private Sub CalculateButton_Click(ByVal sender As [Link], _ ByVal e As [Link])
Handles [Link]
//Calculate the price and discount.
Dim QuantityInteger As Integer
Dim PriceDecimal, ExtendedPriceDecimal, DiscountDecimal, _ DiscountedPriceDecimal As Decimal
//Convert input values to numeric variables.
QuantityInteger = [Link]([Link]) PriceDecimal =
[Link]([Link])
// Calculate values.
ExtendedPriceDecimal = QuantityInteger * PriceDecimal DiscountDecimal = [Link]( _
(ExtendedPriceDecimal * DISCOUNT_RATE_Decimal), 2)
DiscountedPriceDecimal = ExtendedPriceDecimal - DiscountDecimal
//Format and display answers.
[Link] = [Link]("C") [Link] =
[Link]("N")
[Link] = [Link]("C")
End Sub
Private Sub ClearButton_Click(ByVal sender As [Link], _ ByVal e As [Link])
Handles [Link]
//Clear previous amounts from the form.
[Link]()
[Link]()
[Link]()
[Link]()
[Link]()
With QuantityTextBox .Clear() .Focus()
End With
End Sub
Private Sub ExitButton_Click(ByVal sender As [Link], _ ByVal e As [Link])
Handles [Link]
//Exit the project
[Link]()
End Sub