Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- namespace zad
- {
- public partial class Form1 : Form
- {
- interface I1
- {
- double dodaj(double a, double b);
- }
- public class K1 : K2, I1
- {
- public double dodaj(double a, double b) { return a + b; }
- public override double odejmij(double a, double b)
- {
- return a - b;
- }
- }
- public abstract class K2
- {
- public abstract double odejmij(double a, double b);
- public double pomnoz(double a, double b) { return a * b; }
- }
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- K1 k1 = new K1();
- textBox3.Text = k1.dodaj(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)).ToString();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- K1 k1 = new K1();
- textBox3.Text = k1.odejmij(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)).ToString();
- }
- private void button3_Click(object sender, EventArgs e)
- {
- K1 k1 = new K1();
- textBox3.Text = k1.pomnoz(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)).ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement