Question: Using the same code for area of the circle. Write a program that requests the user to only code for rectangle, requests the appropriate lengths,
Using the same code for area of the circle. Write a program that
requests the user to only code for rectangle, requests the appropriate lengths, width of the rectangle and then
gives the area of the figure. Example of the area of the circle coding, Private Sub btnComputeClick Handles btnCompute.Click
Dim shapeNum As Integer
Dim radius, length, height, width As Double
'Input choice of shape and its dimensions
Circle Parallelogram Kite
shapeNum CIntmtbSelectionText
'Mask is
Select Case shapeNum
Case
radius CDblInputBoxInput the radius of the circle:
txtArea.Text CStr radius
Case
length CDblInputBoxInput the length of the parallelogram:
height CDblInputBoxInput the height of the parallelogram:
txtArea.Text CStrlength height
Case
length CDblInputBoxInput the length of the kite:
width CDblInputBoxInput the width of the kite:
txtArea.Text CStrlength width
Case Else
MessageBox.ShowYour choice is not valid.", "Try Again."
mtbSelection.Clear
End Select
mtbSelection.Focus
End Sub
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
