Пример #1
0
        static void Main(string[] args)
        {
            // Prompt user to provide whole number input
            Console.WriteLine("Please provide a whole number");

            // Collect user whole number input
            int userNumber = Convert.ToInt32(Console.ReadLine());

            // Using custom class MathOperations
            // Square the number by using the PowerOfTwo method
            userNumber = MathOperations.PowerOfTwo(userNumber);

            // Add three to the user number using the AddThree method
            userNumber = MathOperations.AddThree(userNumber);

            // Subtract ten from the number using the SubtractTen method
            userNumber = MathOperations.SubtractTen(userNumber);

            // Display the new number in the console
            Console.WriteLine("After a few operations, your number is now " + userNumber);

            // Prevent console from closing at program end
            Console.ReadLine();
        }