Created
August 30, 2020 10:51
-
-
Save pmatthews05/65b45bffdf27c045b0e51182f26a3c65 to your computer and use it in GitHub Desktop.
This file contains 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; | |
using CSharpLibrary; | |
namespace CSharpConsole | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
LibraryProject(); | |
} | |
public static void LibraryProject() | |
{ | |
int row = 0; | |
do | |
{ | |
if (row == 0 || row >= 25) | |
ResetConsole(); | |
string input = Console.ReadLine(); | |
if (String.IsNullOrEmpty(input)) break; | |
Console.WriteLine($"Input: {input} {"Greater than 5? ",30}: " + | |
$"{(input.NumberGreaterThan5() ? "Yes" : "No")}\n"); | |
row += 3; | |
} while (true); | |
return; | |
void ResetConsole() | |
{ | |
if (row > 0) | |
{ | |
Console.WriteLine("Press any key to continue..."); | |
Console.ReadKey(); | |
} | |
Console.Clear(); | |
Console.WriteLine("\nPress <Enter> only to exit; otherwise, enter a string and press <Enter>:\n"); | |
row = 3; | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment