Sorry if it's a bit long... I tried to make it modular with methods, not sure if I overcomplicated itusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Learning{    class Program    {        public static decimal principal;        public static decimal interest;        public static int numYears;        private static string source;        private static bool quitting;        private static string consoleInput;        static void Main(string[] args)        {            while (true)            {                getInput();                if (interest == 0 || principal == 0 || numYears == 0)                {                    break;                }                printAnnual();            }        }        static bool compareStrings(string input)        {            if (string.Equals(input, exit, StringComparison.OrdinalIgnoreCase) || (string.Equals(input, quit, StringComparison.OrdinalIgnoreCase)))            {                return true;            }            else            {                return false;            }        }        static void getInput()        {             principal = getPrincipal();            if (principal == 0)            {                Console.WriteLine(Program will now exit...);            }            else            {                interest = getInterest();                if(interest == 0)                {                    Console.WriteLine(Program will now exit...);                }                else                {                    numYears = getYears();                    if (numYears == 0)                    {                        Console.WriteLine(Program will now exit...);                    }                }            }        }        static void printAnnual()        {            Console.WriteLine();            Console.WriteLine(Principal    =  + principal);            Console.WriteLine(Interest     =  + interest);            Console.WriteLine(Number years =  + numYears);            int years = 1;            while (years <= numYears)            {                principal = decimal.Round(getTotal(principal, interest), 2);                // while (true)                //  {                Console.WriteLine();                Console.WriteLine(years + - + principal);                years++;                //  }            }        }        private static decimal getPrincipal()        {            decimal principal;            while (true)            {                Console.WriteLine();                Console.WriteLine(Enter principal, or exit/quit to quit:);                consoleInput = Console.ReadLine();                quitting = compareStrings(consoleInput);                if (quitting == true)                {                    return 0;                }                principal = Convert.ToDecimal(consoleInput);                if (principal >= 0)                {                    break;                }                Console.WriteLine(Principal cannot be negative);                principal = 0;            }            return principal;        }        private static decimal getInterest()        {            decimal maxInterest = 50;            decimal interest;            while (true)            {                Console.WriteLine(Enter interest, or exit/quit to quit:);                consoleInput = Console.ReadLine();                quitting = compareStrings(consoleInput);                if (quitting == true)                {                    return 0;                }                interest = Convert.ToDecimal(consoleInput);                if (interest <= maxInterest && interest > 0)                {                    break;                }                Console.WriteLine(Interest cannot be negative or greater than  + maxInterest);                interest = 0;            }            return interest;        }        private static int getYears()        {            int numYears;            while (true)            {                Console.WriteLine(Enter number of years, or exit/quit to quit:);                consoleInput = Console.ReadLine();                quitting = compareStrings(consoleInput);                if (quitting == true)                {                    return 0;                }                numYears = Convert.ToInt16(consoleInput);                if (numYears > 0)                {                    break;                }                Console.WriteLine(Error! You cannot have a negative number of years);                numYears = 0;            }            return numYears;        }        private static decimal getTotal(decimal principal, decimal interest)        {            decimal interestAmount = principal * (interest / 100);            return principal + interestAmount;        }    }}
Simple C# Interest Calculating Program
c#;beginner