Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Private Sub btnCompute _ Click ( . . . ) Handles btnCompute.Click Dim shapeNum As Integer Dim radius, length, height, width As Double 'Input choice

Private Sub btnCompute_Click(...) Handles btnCompute.Click
Dim shapeNum As Integer
Dim radius, length, height, width As Double
'Input choice of shape and its dimensions
'1. Circle 2. Parallelogram 3. Kite
shapeNum = CInt(mtbSelection.Text)
'Mask is 0
Select Case shapeNum
Case 1
radius = CDbl(InputBox("Input the radius of the circle: "))
txtArea.Text = CStr(3.141593* radius ^2)
Case 2
length = CDbl(InputBox("Input the length of the parallelogram: "))
height = CDbl(InputBox("Input the height of the parallelogram: "))
txtArea.Text = CStr(length * height)
Case 3
length = CDbl(InputBox("Input the length of the kite: "))
width = CDbl(InputBox("Input the width of the kite: "))
txtArea.Text = CStr((length * width)/2)
Case Else
MessageBox.Show("Your choice is not valid.", "Try Again.")
mtbSelection.Clear()
End Select
mtbSelection.Focus()
End Sub. Explain in detail how this works

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

The amount of work I am asked to do is reasonable.

Answered: 1 week ago

Question

The company encourages a balance between work and personal life.

Answered: 1 week ago