Explore BrainMass
Share

Visual Basic Programming

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

(Average Calculator Application) Write an application that takes three numbers as input in TextBoxes, stores the three integers in variables, then calculates and displays the average of the numbers. The output is displayed in a Label. Figure 3.33 shows the completed application.

Fig. 3.33. Result of Average Calculator application.

Creating the Application: Create a new Windows Forms application named AverageCalculator. Rename its Form1.vb file as AverageCalculator.vb. Set the Form's Font property to Segoe UI 9pt and its Text propertyto AverageCalculator.

Coding the Click event handler: Perform the average calculation in the Calculate Button's Click event handler. Display the average in the resultLabel.

Clearing the result: Write event handlers for the TextBoxes' TextChanged events. Write code to clear resultLabel after the user enters new input into any of the TextBoxes.

Running the application: Select Debug > Start Debugging to run your application. Enter three integers, then verify that the average is calculated properly.

© BrainMass Inc. brainmass.com October 25, 2018, 7:54 am ad1c9bdddf
https://brainmass.com/computer-science/visual-basic/visual-basic-programming-519585

Attachments

Solution Preview

Attached is the complete VB project per task requirements. The executable can be found ...

Solution Summary

A complete VB.NET project. The program will validate that the user has entered valid integer numbers, then it will sum them up and divide by total number of integers to get the average value. Result is displayed on the form in a label control.

$2.19
See Also This Related BrainMass Solution

Your First Visual Basic Program

Practice defining variables and writing assignment statements. For each problem, write the VB statements to accomplish the specified task.

View Full Posting Details