Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, this project is for C# programming in Microsoft Visual Studio. I would great

ID: 3791269 • Letter: H

Question

Hi, this project is for C# programming in Microsoft Visual Studio. I would greatly appreciate any help!! I attached the code I have so far however, I dont know if any of it is correct.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project2
{
    class shapecalc
    {
        static void Main(string[] args)
        {
            int choice, l, h, s, w, d1, d2, b, r, lb, sb;
            double area=0;

            Console.WriteLine(" ");
            Console.WriteLine("Shape Area Calculator: ");
            Console.WriteLine("*****************************************************************");
            Console.WriteLine(" ");

            Console.WriteLine("Please select the number of the operation you would like to perform:");
            Console.WriteLine("1. Circle");
            Console.WriteLine("2. Square");
            Console.WriteLine("3. Rectangle");
            Console.WriteLine("4. Rhombus");
            Console.WriteLine("5. Parallelogram");
            Console.WriteLine("6. Trapezoid");
            Console.WriteLine("7. Exit");
            Console.WriteLine(" ");
            Console.WriteLine("********************************************************************");
            Console.WriteLine("Select a shape type to calculate : ");
            choice = Convert.ToInt32(Console.ReadLine());

            switch(choice)

       static private void CalculateCircle()
        {
            Console.WriteLine("Enter the length of the radius of the Circle (-1 to exit back to menu) : ");
            r = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of Circle is:{0}", 3.14 * r * r);
        }

        static private void CalculateRectangle()
        {
            Console.WriteLine("Enter the length of on side of the rectangle (-1to exit back to menu) : ");
            l = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the width of the Rectangle");
            w = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of rectangle is :{0}", l * w);
        }

        static private void CalculateSquare()
        {
            Console.WriteLine("Enter the length of one side of the square (-1 to exit back to menu) : ");
            s = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of Square is:{0}", s * s);
        }
        static private void CalculateRhombus()
        {
            Console.WriteLine("Enter the length of one diagonal of the rhombus (-1 to exit back to menu) : ");
            d1 = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the length of the other diagonal of the rhombus (-1 to exit back to menu : ");
            d2 = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of the Rhombus is : {0}", (d1 * d2) / 2);
        }

        static private void CalculateParallelogram()
        {
            Console.WriteLine("Enter the length of the base of the parallelogram (-1 to exit back to menu) : ");
            b = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the height of the parallelogram (-1 to exit back to menu) : ");
            h = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of the Parallelogram is : {0}", b * h);
        }
        static private void CalculateTrapezoid()
        {
            Console.WriteLine("Enter the length of the large base of the trapezoid (-1 to exit back to menu) : ");
            lb = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the length of the small base of the trapezoid (-1 to exit back to menu) : ");
            sb = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the height of the trapezoid (-1 to exit back to menu) : ");
            h = double.Parse(Console.ReadLine());
            Console.WriteLine("Area of the Parallelogram is : {0}", (lb + sb) * (h / 2));
        }
    }
}

You name your Console App Project Project02AreaCalculator This project will calculate the areas of one of six shapes. Those six shapes will be 1. Circle 2. Square 3. Rectangle 4. Rhombus 5. Parallelogram 6. Trapezoid You'll find the formulas at http://www. coolmath. com/referencelareas In this Project you're going to create a console application that will have a menu in the Main method asking the user to enter which shape they'd like to find the area of include error checking so that if they make a menu selection that is not in the menu you will simply refresh the page until they make a correct menu selection. The last menu selection should be for quit and if they select this then clear the screen and say goodbye asking for a press any key to end. The menu should look like this: Shape Area Calculator 1. Circle Square 3. Rectangle Rhombus 5. Parallelogram Trapezoid 7. Exit Select a shape type to calculate: Once their selection is made you call a method for that shape and then prompt the user for input (according to the shape type) and then figure the area. The methods will be designated as type static, have a return type of void, and have no parameters

Explanation / Answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Project2
{
class shapecalc
{
public float l, h, s, w, d1, d2, b, r, lb, sb;
static void Main(string[] args)
{
shapecalc a = new shapecalc();
Console.WriteLine(" ");
Console.WriteLine("Shape Area Calculator: ");
Console.WriteLine("*****************************************************************");
Console.WriteLine(" ");
Console.WriteLine("Please select the number of the operation you would like to perform:");
Console.WriteLine("1. Circle");
Console.WriteLine("2. Square");
Console.WriteLine("3. Rectangle");
Console.WriteLine("4. Rhombus");
Console.WriteLine("5. Parallelogram");
Console.WriteLine("6. Trapezoid");
Console.WriteLine("7. Exit");
Console.WriteLine(" ");
Console.WriteLine("********************************************************************");
Console.WriteLine("Select a shape type to calculate : ");
choice = Convert.ToInt32(Console.ReadLine());
switch(choice)
{
case1:
{
a.circle();
break;
}
case2:
   {
a.square();
break;   
    }
case3:
   {          
a.rectangle();
break;
}
case4:
   {
a.rhombus();
break;
}
case5:
{
a.parallelogram();
break;
}
case6:
{
a.trapezoid();
break;
}
case7:
break;
console.ReadKey();
}
}
}
}
public void circle()
{
console.WriteLine("enter the radius of the circle");
radius = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Area of Circle is:{0}", 3.14 * radius * radius);
}
public void Square()
{
Console.WriteLine("Enter the side of a square");
side = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Area of Square is:{0}", side * side);
}
public void rectangle()
{
Console.WriteLine("Enter the length of the rectangle");
l = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Enter the width of the rectangle");
w = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Area of rectangle is :{0}", l * w);
}
public void rhombus()
{
Console.WriteLine("Enter thelength of one diagonal of the rhombus");
d1 = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Enter thelength of other diagonal of the rhombus");
d2 = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);   
Console.WriteLine("Area of the Rhombus is : {0}", (d1 * d2) / 2 );
}
public void parallelogram()
{
Console.WriteLine("Enter the length of the base of the parallelogram");
b = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Enter the height of the base of the parallelogram");
h = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Area of the Parallelogram is : {0}", b * h );
}
public void Trapezoid()
{
Console.WriteLine("Enter the length of the large base of the trapezoid");
lb = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Enter the length of the small base of the trapezoid");
sb = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Enter the height of the trapezoid");
h = float.Parse(Console.ReadLine());
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Area of parallelogram is:{0}",(lb + sb) * (h / 2));
}


  


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote