Páginas

Ejercicio 3

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ejercicio1
{
    public partial class ejercico4 : Form
    {
        public ejercico4()
        {
            InitializeComponent();
        }

        private void ejercico4_Load(object sender, EventArgs e)
        {
           
                cbosuel.Items.Add("gerente");
                cbosuel.Items.Add("admi");
                cbosuel.Items.Add("otros");
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int sueldo = 0;
            if (cbosuel.Text == "gerente")
            {
                sueldo = 4500;
            }
            else if (cbosuel.Text == "admi")
            {
                sueldo = 2300;
            }
            else if (cbosuel.Text == "otros")
            {
                sueldo = 1000;
            }
            textBox1.Text = sueldo.ToString();
        }
     
    }

}

Ejercicio 2

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ejercicio1
{
    public partial class ejercicio3 : Form
    {
        public ejercicio3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int p, c;
            double sub, igv, total;
            p = int.Parse(textBox1.Text);
            c = int.Parse(textBox2.Text);
            sub = p * c;
            igv = p * 0.18;
            total = sub - igv;

            textBox3.Text = sub.ToString();
            textBox4.Text = igv.ToString();
            textBox5.Text = total.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            textBox4.Text = "";
            textBox5.Text = "";


        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }

}

Ejercicio 1

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ejercicio1
{
    public partial class ejercicio2 : Form
    {
        public ejercicio2()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int sue;
            double boni, des, tot;
            sue = int.Parse(textBox1.Text);
            boni = sue * 0.005;
            des = sue * 0.002;
            tot = (sue + boni) - des;
            textBox2.Text = boni.ToString();
            textBox3.Text = des.ToString();
            textBox4.Text = tot.ToString();
        }
    }

}