Write a VB program that will solve the area of thetrapezoid given the values: (a=16, b=18, height=7). Give your answer.
Question
Write a VB program that will solve the area of the trapezoid given the values:
- a = 16
- b = 18
- height = 7
Give your answer.
Solution
Here is a simple VB program that calculates the area of a trapezoid:
Module Module1
Sub Main()
' Declare variables
Dim a As Double = 16
Dim b As Double = 18
Dim height As Double = 7
Dim area As Double
' Calculate area
area = 0.5 * (a + b) * height
' Print area
Console.WriteLine("The area of the trapezoid is: " & area)
Console.ReadLine()
End Sub
End Module
This program first declares the variables a, b, and height and assigns them the given values. It then calculates the area of the trapezoid using the formula 0.5 * (a + b) * height and assigns the result to the variable area. Finally, it prints the area to the console.
Similar Questions
Write a VB program that will solve the area of thetrapezoid given the values: (a=16, b=18, height=7). Give your answer.
Write a VB Program that calculates the area of a rectangle give that the area = lengthmultiplied by width.
Find the area of the parallelogram with vertices A=(3,2,0),B=(8,3,0),C=(5,7,,0),and D=(10,8,0).
Which of the following is the formula for the volume of a pyramid with base area B and height h?A.B.V = BhC.V = BhD.V = -Bh
In the figure below, B lies between A and C.Find the location of B so that AB is 16 of AC.A−27C3B?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.