Code an application that calculates and displays a customer’s discount and the total amount the customer owes. Create a Visual Basic Windows application. Use the following names for the solution, project, and form file, respectively: Mingo Solution, Mingo Project, and Main Form.vb. The user will enter the quantity ordered and price (per unit) in the text boxes. Code the Calculate button’s Click event procedure. The procedure should verify that the text boxes contain valid data. (Hint: Use the Boolean value returned by the TryParse method.) If both text boxes contain valid data, the procedure should calculate and display both a ten percent discount and the total amount the customer owes; otherwise, it should display an appropriate message in a message box. Display the discount with two decimal places. Display the total due with a dollar sign and two decimal places. The discount and total due should be removed from the interface when a change is made to the contents of a text box. Save the solution and then start and test the application. Close the Code Editor window and then close the solution

The given task requires the creation of a Visual Basic Windows application that calculates and displays a customer’s discount and the total amount owed. The application will take input from the user in the form of quantity ordered and price per unit. The application should verify that the input is valid, calculate the discount and total amount owed, and display the results.

To begin, create a new solution named “Mingo Solution” and within that, create a new project named “Mingo Project”. In the project, create a new form file named “Main Form.vb”.

Within the Main Form.vb file, create a button called “Calculate” and two text boxes named “txtQuantity” and “txtPrice”. The Calculate button will have a Click event procedure assigned to it.

In the Click event procedure, first we will verify the validity of the data entered in the text boxes. This can be done by using the TryParse method, which returns a Boolean value indicating whether the conversion from string to numeric was successful.

We will use the TryParse method to convert the contents of txtQuantity and txtPrice to numeric values. If both conversions are successful, we can proceed with the calculations. Otherwise, we will display an appropriate message in a message box indicating that the input is invalid.

If the data is valid, we will calculate the discount and total amount owed. The discount will be calculated as 10% of the total cost, which is equal to the quantity ordered multiplied by the price per unit. The total amount owed will be the total cost minus the discount.

To display the results, we will create two labels on the form to show the discount and total amount owed. We will format the discount to display with two decimal places and the total amount owed to display with a dollar sign and two decimal places.

Additionally, we will add event handlers for the text boxes’ TextChanged events. These event handlers will update the discount and total amount owed labels whenever a change is made to the contents of a text box. This will ensure that the interface is updated dynamically.

Finally, we will save the solution and run the application to test its functionality. Once testing is complete, we will close the Code Editor window and then close the solution.

In conclusion, the given task requires the creation of a Visual Basic Windows application to calculate and display a customer’s discount and the total amount owed. By following the steps provided, we can create an application that meets these requirements efficiently.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer