Exemple #1
0
 private void button20_Click(object sender, EventArgs e)
 {
     a = float.Parse(textBox1.Text);
     textBox1.Clear();
     calcool     = calc.divisionWithRem;
     label1.Text = "%";
 }
Exemple #2
0
 // added sign / to the label
 private void button19_Click(object sender, EventArgs e)
 {
     a = float.Parse(textBox1.Text);
     textBox1.Clear();
     calcool     = calc.dived;
     label1.Text = "/";
 }
Exemple #3
0
 // added sign + to the label
 private void button12_Click(object sender, EventArgs e)
 {
     a = float.Parse(textBox1.Text);
     textBox1.Clear();
     calcool     = calc.plus;
     label1.Text = "+";
     plusOrMinus = true;
 }
Exemple #4
0
 private void button21_Click(object sender, EventArgs e)
 {
     if (plusOrMinus)
     {
         c = double.Parse(textBox1.Text);
         textBox1.Clear();
         calcool     = calc.sqrt;
         label1.Text = "sqrt";
     }
 }
Exemple #5
0
 static void Main(string[] args)
 {
     //A a = new A();
     //a.Method();
     //B b = new B();
     //b.OldMethod();
     //Trace.Msg("Now in Main Method");
     //Console.WriteLine("Done.");
     Calculator.calc cl = new calc(100, 200);
     Console.WriteLine(cl.Addition(100, 200));
 }
        static void Main(string[] args)
        {
            calc calcu = new calc();

            Console.WriteLine("Enter date of birth (dd-MM-yyyy");
            String   inputdate = Console.ReadLine();
            DateTime result;

            Console.WriteLine(calcu.ParseInput(inputdate, out result));
            while (!calcu.ParseInput(inputdate, out result))
            {
                Console.WriteLine("Enter date of birth (dd-MM-yyyy");
                inputdate = Console.ReadLine();
            }
            if (calcu.ParseInput(inputdate, out result))
            {
                Console.WriteLine(calcu.CalculateAge(result));
                Console.WriteLine("Success!");
                Console.ReadLine();
            }
        }
Exemple #7
0
 private void button23_Click(object sender, EventArgs e)
 {
     if (!plusOrMinus)
     {
         textBox1.Text = "Error!";
     }
     else
     {
         fuc = int.Parse(textBox1.Text);
         if (fuc > 15)
         {
             textBox1.Text = "04ень много! меньше 15 вводи!";
             timer1_Tick(sender, e);
         }
         else
         {
             calcool     = calc.fuct;
             label1.Text = "!";
         }
     }
 }
 //==================================
 private void Operator(calc.Operators o)
 {
     try
     {
         string result = c.Operator(o);
         UpdateResult(result);
     }
     catch (Exception e)
     {
         ExceptionHandling(e);
     }
 }
Exemple #9
0
 private void button27_Click(object sender, EventArgs e)
 {
     a           = int.Parse(textBox1.Text);
     label1.Text = "Binary";
     calcool     = calc.binary;
 }
Exemple #10
0
 private void button22_Click(object sender, EventArgs e)
 {
     a           = float.Parse(textBox1.Text);
     calcool     = calc.power;
     label1.Text = "Double Power";
 }