Answer to Question #312121 in Visual Basic for Tshepii

Question #312121

Get the length and width of a rectangular field.Calculate the area and perimeter and display it








1
Expert's answer
2022-03-15T12:46:07-0400


Module Module1


    Sub Main()
        'Get the length and width of a rectangular field
        Console.Write("Enter the length of a rectangular field: ")
        Dim length As Integer = Integer.Parse(Console.ReadLine())
        Console.Write("Enter the width of a rectangular field: ")
        Dim width As Integer = Integer.Parse(Console.ReadLine())
        'Calculate the area and perimeter and display it. Length 52.5 and width 18.6
        Dim area As Double = length * width
        Dim perimeter As Double = 2 * (length + width)
        'display the area of a rectangular field
        Console.WriteLine("The area of a rectangular field: " + area.ToString())
        'display the perimeter of a rectangular field
        Console.WriteLine("The perimeter of a rectangular field: " + perimeter.ToString())


        Console.ReadLine()
    End Sub


End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS