Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Created August 30, 2020 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatthews05/65b45bffdf27c045b0e51182f26a3c65 to your computer and use it in GitHub Desktop.
Save pmatthews05/65b45bffdf27c045b0e51182f26a3c65 to your computer and use it in GitHub Desktop.
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