Created
November 18, 2020 17:55
-
-
Save mattleibow/bd2fb2b345bb6e81aa3f797ba3a3cf7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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