Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

=+. Let 2 be the unit square [(x, y): 0 Answered: 1 week ago

Answered: 1 week ago

Question

Develop a program for effectively managing diversity. page 303

Answered: 1 week ago

Question

List the common methods used in selecting human resources. page 239

Answered: 1 week ago