107 303
Assignments Done
98.9%
Successfully Done
In March 2023

Answer to Question #248102 in C# for scott

Question #248102

Choose your desired operation

[CIRCUMFERANCE OF A CIRCLE]

[PERIMITER OF A TRIANGLE]

1
2021-10-07T13:59:49-0400
using System;

namespace App
{
class Program
{
static void Main(string[] args)
{

int operation = -1;
while (operation != 3)
{
Console.WriteLine("1. CIRCUMFERANCE OF A CIRCLE");
Console.WriteLine("2. PERIMITER OF A TRIANGLE");
Console.WriteLine("3. EXIT");
Console.Write("Choose your operation: ");
if (operation == 1)
{
Console.WriteLine("Enter a radius of a circle: ");
double circumferenceCircle = 2 * Math.PI * radius;
Console.WriteLine("Circumference of a circle : {0}", circumferenceCircle);
}
else if (operation == 2)
{
Console.WriteLine("Enter a side 1 of a triangle: ");
double side1 = double.Parse(Console.ReadLine());
Console.WriteLine("Enter a side 2 of a triangle: ");
double side2 = double.Parse(Console.ReadLine());
Console.WriteLine("Enter a side 3 of a triangle: ");
double side3 = double.Parse(Console.ReadLine());
double perimiter = side1 + side2 + side3;
Console.WriteLine("Perimiter of a triangle : {0}", perimiter);
}
}

}
}
}

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!