Skip to content

Instantly share code, notes, and snippets.

@mattleibow
Created November 18, 2020 17:55
Show Gist options
  • Save mattleibow/bd2fb2b345bb6e81aa3f797ba3a3cf7e to your computer and use it in GitHub Desktop.
Save mattleibow/bd2fb2b345bb6e81aa3f797ba3a3cf7e to your computer and use it in GitHub Desktop.
using System;
namespace ConsoleApp7
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("My Cool App!");
Console.WriteLine("There are some options:");
Console.WriteLine(" 1. Counter");
Console.WriteLine(" 2. Adder");
Console.WriteLine(" 3. Shaper");
var input = Console.ReadLine();
switch (input)
{
case "1":
Console.WriteLine("You selected '1. Counter'");
Console.WriteLine("What type of counter do you want?");
Console.WriteLine(" a) ones");
Console.WriteLine(" b) fives");
Console.WriteLine(" c) tens");
var subInput = Console.ReadLine();
switch (subInput)
{
case "a":
{
Console.WriteLine("You selected 'a) ones'");
Console.WriteLine("Here is a quick counter!");
Console.WriteLine("But first, how many iterations do you want?");
var iterationsString = Console.ReadLine();
var iterations = int.Parse(iterationsString);
var counter = 0;
for (int i = 0; i < iterations; i++)
{
counter += 1;
Console.WriteLine($"Counting {counter}");
}
}
break;
case "b":
{
Console.WriteLine("You selected 'b) fives'");
Console.WriteLine("Here is a quick counter!");
Console.WriteLine("But first, how many iterations do you want?");
var iterationsString = Console.ReadLine();
var iterations = int.Parse(iterationsString);
var counter = 0;
for (int i = 0; i < iterations; i++)
{
counter += 5;
Console.WriteLine($"Counting {counter}");
}
}
break;
case "c":
break;
}
break;
case "2":
break;
case "3":
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment