static void Main(string[] args) { //int i = 0; //do //{ // MethodBench.PrintMm(); // i++; //} //while (i < 3); //MethodBench.PrintString("C# now and forever"); Console.Write("Sriv något "); string input = Console.ReadLine(); MethodBench.PrintString(input); //Console.Write("Byt till stora eller små bokstäver b/s "); //ConsoleKeyInfo consoleKey = Console.ReadKey(); //Console.WriteLine(); //switch (consoleKey.Key) //{ // case ConsoleKey.B: // MethodBench.PrintUpperOrLower(input, true); // break; // case ConsoleKey.S: // MethodBench.PrintUpperOrLower(input, false); // break; // default: // break; //} Console.Write("Vill du skrika eller viska? s/v "); ConsoleKeyInfo choice = Console.ReadKey(); Console.WriteLine(); while (choice.Key != ConsoleKey.S && choice.Key != ConsoleKey.V) { Console.Write("\nSkriv s eller v "); choice = Console.ReadKey(); } bool shout = MethodBench.Shout(choice); Console.WriteLine(); MethodBench.PrintUpperOrLower(input, shout); MethodBench.PrintUpperOrLower(input, MethodBench.Shout(choice)); }
static void Main(string[] args) { MethodBench methodBench = new MethodBench(); bool shout = methodBench.FourthMethod(); int conditional = 0; do { methodBench.FirstMethod(); conditional++; } while (conditional < 3); methodBench.SecondMethod("C# Now and Forever!"); string userSentance = Console.ReadLine(); methodBench.SecondMethod(userSentance); bool makeChoice = true; bool isLargeSmall = false; while (makeChoice) { Console.WriteLine("Type 'small' for the output to be in small letters or 'large' for large letters!: "); string largeSmall = Console.ReadLine(); if (largeSmall == "large") { isLargeSmall = true; makeChoice = false; } else if (largeSmall == "small") { isLargeSmall = false; makeChoice = false; } else { Console.WriteLine("Invalid input. Type large/small! "); } } methodBench.ThirdMethod(userSentance, isLargeSmall); methodBench.ThirdMethod(userSentance, shout); methodBench.ThirdMethod(userSentance, methodBench.FourthMethod()); }