private void RunUserChoice()
        {
            var chosenShapeIndex = InputOutput.CollectInt("desired shape") - 1;

            if (chosenShapeIndex < 0 || chosenShapeIndex > shapeList.Count + 1)
            {
                Console.WriteLine("Invalid input - please try again.");
                RunUserChoice();
            }

            if (chosenShapeIndex == shapeList.Count)
            {
                HelpMenu helpMenu = new HelpMenu();
                helpMenu.Run();
            }
            else if (chosenShapeIndex == shapeList.Count + 1)
            {
                Environment.Exit(0);
            }
            else
            {
                shapeList[chosenShapeIndex].Run();
            }
        }
Exemple #2
0
 void Output()
 {
     InputOutput.OutputDouble("Volume", volume);
     InputOutput.OutputDouble("Surface Area", surfaceArea);
 }
Exemple #3
0
 void Input()
 {
     length = InputOutput.CollectDouble("Edge Length");
 }
 void Output()
 {
     InputOutput.OutputDouble("Area", area);
 }
Exemple #5
0
 void Input()
 {
     length = InputOutput.CollectDouble("Height");
     radius = InputOutput.CollectDouble("Radius");
 }
 void Output()
 {
     InputOutput.OutputDouble("Area", area);
     InputOutput.OutputDouble("Perimeter", perimeter);
 }