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(); } }
void Output() { InputOutput.OutputDouble("Volume", volume); InputOutput.OutputDouble("Surface Area", surfaceArea); }
void Input() { length = InputOutput.CollectDouble("Edge Length"); }
void Output() { InputOutput.OutputDouble("Area", area); }
void Input() { length = InputOutput.CollectDouble("Height"); radius = InputOutput.CollectDouble("Radius"); }
void Output() { InputOutput.OutputDouble("Area", area); InputOutput.OutputDouble("Perimeter", perimeter); }