Answer to Question #182070 in Visual Basic for Anna

Question #182070

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


1
Expert's answer
2021-04-16T11:04:56-0400
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



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS