How to solve it?
[10 Marks] 2. Write a C# application that asks the user to input the required data to implement the two methods below: (Use Method Overloading to write the methods) a. Method Perimeter that takes as input, a double value (length), calculates the perimeter of a square, and displays it. [Perimeter = 4 * length] b. Method Perimeter that takes as input two double values (length) and (width), calculates the perimeter of a rectangle, and displays it. [Perimeter = 2* (length + width)] Sample I/O Enter the length of the square: 3.2 Enter the length of the rectangle: 5.1 Enter the width of the rectangle: 2.3 The perimeter of the square is 12.8 The perimeter of the rectangle is 14.8 [15 Marks]
How to solve it?
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am