Write an enumerated data type that describes types of triangles based on the number of equal sides. The types are equilateral (3 equal sides), isosceles (2 equal sides), and scalene (0 equal sides).  Write the complete enum. Include a variable/field in the enum that represents the number of equal sides for that type of triangle.  Include a getter for this variable. Include a toString method. Write a statement to create a variable of your enum type called myFavoriteTriangleType. Initialize the variable to some value. This statement would go in a separate class, perhaps in a main method

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter7: Using Methods
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question

Write an enumerated data type that describes types of triangles based on the number of equal sides.

The types are equilateral (3 equal sides), isosceles (2 equal sides), and scalene (0 equal sides). 

  1. Write the complete enum.
    • Include a variable/field in the enum that represents the number of equal sides for that type of triangle. 
    • Include a getter for this variable.
    • Include a toString method.
  2. Write a statement to create a variable of your enum type called myFavoriteTriangleType.
    • Initialize the variable to some value.
    • This statement would go in a separate class, perhaps in a main method.
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,