107 285
Assignments Done
97.9%
Successfully Done
In March 2023

# Answer to Question #255009 in C# for Scott

Question #255009

Create a menu to calculate the area and perimeter of different figures

a)Triangle        e)Oval

b)Trapezium    f)Hexagon

c)Circle           g)Pentagon

d))Cone           h)Decagon

Create a Midi Parent form

Progress bar/Slash Screen

1
2021-10-22T04:53:45-0400
using System;
public class Exercise
{
public static void Main()
{
int choice,r,l,w,b,h;
double area=0;

Console.Write("\n\n");
Console.Write("A menu driven program to compute the area of various geometrical shape:\n");
Console.Write("-------------------------------------------------------------------------");
Console.Write("\n\n");

Console.Write("Input 1 for area of circle\n");
Console.Write("Input 2 for area of rectangle\n");
Console.Write("Input 3 for area of triangle\n");

switch(choice)
{
case 1:
Console.Write("Input radius of the circle : ");
area=3.14*r*r;
break;
case 2:
Console.Write("Input length  of the rectangle : ");
Console.Write("Input  width of the rectangle : ");
area=l*w;
break;
case 3:
Console.Write("Input the base of the triangle :");
Console.Write("Input the hight of the triangle :");
area=.5*b*h;
break;
}
Console.Write("The area is : {0}\n",area);
}
}

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!