VB.NET Calculator: Selling Calculator Assignment - University XYZ

Verified

Added on  2022/08/12

|4
|253
|157
Practical Assignment
AI Summary
This assignment presents a solution for a VB.NET selling calculator. The solution includes the complete code, which utilizes radio buttons for color selection and a checkbox for a foldable option. The code calculates the price based on these selections, using a `GetMatColor` function to determine the base price and additional logic to handle the foldable option. The assignment also details the testing process, demonstrating the functionality with various input combinations, including standard, deluxe, and premium mat types, along with different color selections. The solution showcases the implementation of a user-friendly interface with buttons for calculation and exit. The assignment showcases how to implement a calculator in VB.NET.
Document Page
Running head: MAT SELLING CALCULATOR USING VISUAL BASIC
MAT SELLING CALCULATOR USING VISUAL BASIC
Name of the Student
Name of the University
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1MAT SELLING CALCULATOR USING VISUAL BASIC
Solution 8
Code Part:
Public Class Form1
Private Function GetMatColor(ByVal intColor As Integer) As Integer
If radBlue.Checked Then
Return intColor
ElseIf radRed.Checked Then
Return intColor + 10
Else
Return intColor + 15
End If
End Function
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles
btnCalculate.Click
Dim intType As Integer
If radStandard.Checked Then
intType = GetMatColor(99)
ElseIf radDeluxe.Checked Then
intType = GetMatColor(129)
Else
intType = GetMatColor(179)
End If
If chkFoldable.Checked Then
intType += 25
lblPrice.Text = intType.ToString("C0")
Else
lblPrice.Text = intType.ToString("C0")
End If
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles
btnExit.Click
Me.Close()
End Sub
End Class
Document Page
2MAT SELLING CALCULATOR USING VISUAL BASIC
Testing the application with data:
Fig: Testing the application with same options to that of the problem statement
Fig: Testing the application with same radio button options to that of the problem statement
(with Foldable Check Box Checked)
Fig: Testing the application with Deluxe Pink radio button options checked (and Foldable
Check Box Checked)
Document Page
3MAT SELLING CALCULATOR USING VISUAL BASIC
Fig: Testing the application with Premium Red radio button options checked (and Foldable
Check Box Unchecked)
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]