avatar
Untitled

Guest 262 2nd Oct, 2023

MARKUP 2.02 KB
                                           
                         using System;

namespace ConsoleApp1
{
    class Program
    {
        public static double FinalNumber;
        public static String FirstNuber;
        public static String NumberToCalculations;
        public static String Choice;
        static void Main(string[] args)
        {
            do
            {
                Console.WriteLine("Declare your first number");
                FirstNuber = Console.ReadLine();

                Console.WriteLine("1. add number");
                Console.WriteLine("2. subsract nuber");
                Console.WriteLine("3. multiply number");
                Console.WriteLine("4. divide number");
                Choice = Console.ReadLine();
                Console.WriteLine("Declare second number");
                NumberToCalculations = Console.ReadLine();
                switch (Choice)
                {

                    case "1":
                        FinalNumber = (Convert.ToDouble(FirstNuber)) + (Convert.ToDouble(NumberToCalculations));
                        break;

                    case "2":
                        FinalNumber = (Convert.ToDouble(FirstNuber)) - (Convert.ToDouble(NumberToCalculations));

                        break;

                    case "3":
                        FinalNumber = (Convert.ToDouble(FirstNuber)) * (Convert.ToDouble(NumberToCalculations));
                        break;

                    case "4":
                        FinalNumber = (Convert.ToDouble(FirstNuber)) / (Convert.ToDouble(NumberToCalculations));
                        break;

                }


                Console.WriteLine(FinalNumber);

                Console.WriteLine("You want to come back?");
                String Back = Console.ReadLine();
                int back = Convert.ToInt32(Back);

            } while (back);





        }
    }
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes
Ta strona używa plików cookie w celu usprawnienia i ułatwienia dostępu do serwisu oraz prowadzenia danych statystycznych. Dalsze korzystanie z tej witryny oznacza akceptację tego stanu rzeczy.
Wykorzystywanie plików Cookie
Jak wyłączyć cookies?
ROZUMIEM