Draw a flowchart and develop an application that will store the salesperson’s code, which is to be entered in the codeTextBox, in an Integer variable named code. The application will need to store the sales amount, which is to be entered in the salesTextBox, in a decimal variable named sales. Display the result of the calculation, or the error message, in the messageLabel. Name your Program SalesAccount.
Also provide a picture of the program's design
VB.NET CODE:
Public Class mainForm
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-us")
Dim code As Integer = 0
Dim sales As Decimal = 0
If Integer.TryParse(codeTextBox.Text, code) = False Then
messageLabel.Text = "Error: enter a correct code."
Return
End If
If Decimal.TryParse(salesTextBox.Text, sales) = False Then
messageLabel.Text = "Error: enter a correct sales."
Return
End If
messageLabel.Text = "The total sales: " + sales.ToString("C")
End Sub
End Class
The flowchart
a picture of the program's design
Comments
Leave a comment