Purchase Solution

Hypotenuse of a Triangle using Pythagorean Theorem in VB

Not what you're looking for?

Ask Custom Question

Calculate the hypotenuse of a right-angled triangle. The Pythagorean theorem. The application should also allow the user to perform a cylinder volume calculation.

Pythagorean theorem formula:
a2 + b2 = c2

Cylinder volume formula:
Cylinder volume = r2 h

Allow the user to enter the value of "a" and the value of "b" to calculate c2.
Use NumericUpdown controls for both a and b to allow the user to enter the values.
Use NumericUpdown controls to enter the value of "r" and "h" in the cylinder volume calculation.
Display the result in a text box and set it as read-only.
Create a group box with two radio buttons that would allow the user to select which calculation to perform (Pythagorean theorem or cylinder volume).
Make the Calculate button the Accept button.
Create a Clear button that will clear the result text box and reset both NumericUpdown controls.
Create an Exit button.
Use labels to identify the input and output controls and change the label text value according to the radio button selected.

Purchase this Solution

Solution Summary

Solution shows in Visual Basic (VB), how to calculate the hypotenuse of a right-angled triangle using the Pythagorean theorem. The application also allows the user to perform cylinder volume calculations.
The problem requires you to find:
a) the Hypotenuse of a Right-Angled Triangle given its two right-angled sides a and b.
b) the volume of a cylinder given it's radius r and height h.

The attached solution will show you how to:
1) create a vb GUI interface (form) to place the appropriate NumericUpDown controls
2) Take input for two different functions (a and b) from the same set of NumericUpDown controls with
3) the use of Radio buttons for function selection in a group box, and
4) how to change the label and output information for the output display textbox
5) consider when a triangle is invalid

The code has been extensively commented, so that you can understand.

Solution Preview

The problem requires you to find:
a) the Hypotenuse of a Right-Angled Triangle given its two right-angled sides a and b.
b) the volume of a cylinder given it's radius ...

Purchase this Solution


Free BrainMass Quizzes
Know Your Linear Equations

Each question is a choice-summary multiple choice question that will present you with a linear equation and then make 4 statements about that equation. You must determine which of the 4 statements are true (if any) in regards to the equation.

Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

Probability Quiz

Some questions on probability

Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.

Solving quadratic inequalities

This quiz test you on how well you are familiar with solving quadratic inequalities.