using System.IO;
namespace Calculadora
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double a;
double b;
string c;
private void btn1_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "1";
}
else
{
txtpantalla.Text = txtpantalla.Text + "1" ;
}
}
private void btn2_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "2";
}
else
{
txtpantalla.Text = txtpantalla.Text + "2";
}
}
private void btn3_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "3";
}
else
{
txtpantalla.Text = txtpantalla.Text + "3";
}
}
private void btn4_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "4";
}
else
{
txtpantalla.Text = txtpantalla.Text + "4";
}
}
private void btn5_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "5";
}
else
{
txtpantalla.Text = txtpantalla.Text + "5";
}
}
private void btn6_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "6";
}
else
{
txtpantalla.Text = txtpantalla.Text + "6";
}
}
private void btn7_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "7";
}
else
{
txtpantalla.Text = txtpantalla.Text + "7";
}
}
private void btn8_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "8";
}
else
{
txtpantalla.Text = txtpantalla.Text + "8";
}
}
private void btn9_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "9";
}
else
{
txtpantalla.Text = txtpantalla.Text + "9";
}
}
private void btn0_Click(object sender, EventArgs e)
{
if (txtpantalla.Text == "")
{
txtpantalla.Text = "0";
}
else
{
txtpantalla.Text = txtpantalla.Text + "0";
}
}
private void btndivision_Click(object sender, EventArgs e)
{
a = Convert.ToDouble(this.txtpantalla.Text);
c = "/";
this.txtpantalla.Clear();
this.txtpantalla.Focus();
}
private void btnmultiplicacion_Click(object sender, EventArgs e)
{
a = Convert.ToDouble(this.txtpantalla.Text);
c = "*";
this.txtpantalla.Clear();
this.txtpantalla.Focus();
}
private void btnresta_Click(object sender, EventArgs e)
{
a = Convert.ToDouble(this.txtpantalla.Text);
c = "-";
this.txtpantalla.Clear();
this.txtpantalla.Focus();
}
private void btnsuma_Click(object sender, EventArgs e)
{
a = Convert.ToDouble(this.txtpantalla.Text);
c = "+";
this.txtpantalla.Clear();
this.txtpantalla.Focus();
}
private void btnpunto_Click(object sender, EventArgs e)
{
if (this.txtpantalla.Text.Contains('.')==false)
{
this.txtpantalla.Text = this.txtpantalla.Text + ".";
}
}
private void btnigual_Click(object sender, EventArgs e)
{
b = Convert.ToDouble(this.txtpantalla.Text);
switch (c)
{
case "+":
this.txtpantalla.Text = Convert.ToString (b + a);
break;
case "-":
this.txtpantalla.Text = Convert.ToString(b - a);
break;
case "*":
this.txtpantalla.Text = Convert.ToString(b * a);
break;
case "/":
this.txtpantalla.Text = Convert.ToString(b / a);
break;
}
}
private void btnprint_Click(object sender, EventArgs e)
{
StreamWriter Archivo = new StreamWriter("Ruta\\archivo.txt");
Archivo.WriteLine("Operaciones: " + a + c + b + "=" + this.txtpantalla.Text);
Archivo.Flush();
Archivo.Close();
System.Diagnostics.Process.Start("Ruta\\archivo.txt");
}
private void btnlimpiar_Click(object sender, EventArgs e)
{
a = Convert.ToDouble("");
b = Convert.ToDouble("");
this.txtpantalla.Text = "";
}
}
}
Comentarios sobre la versión: 1.0 (9)
me podrías ayudar con este proyecto:
1 parate: Consiste en realizar una Nómina para Colombia con las Normas y tarifas del 2018 en C# - ASP.SET, se realizará la Nómina para 1 solo Empleado cuyos datos de entrada serán CEDULA - SUELDO - DÍAS - #HRN #HED #HEN #HEDD #HEDN un Botón CALCULAR y debe aparecer toda la Nómina del Colaborador.
2 parte: Para Sueldo entre 1 Salario Mínimo legal vigente en el 2018
y 3 Salarios mínimos se les dará una bonificación del 15%
y para los sueldos que superen los 3 Salarios se les dará una bonificación del 12.5%
Tenga en cuenta que la Bonificación debe sumar al Total Devengado y obviamente al Neto a pagar.
Mostrar en un TextBox el Calculo de la Bonificación.
3 parte: consiste en realizar y entregar un Proyecto Final de Nómina 2018 para Colombia para 21 Empleados Que permita Crear Empleados, Buscar por Numero de Cedula y traer toda la informacion del Empleado liquidada, Minimo debe presentar 2 Formularios, tener en cuenta que deben permitir modificar un registro de los datos básicos, no permitir modificar los Datos Calculados y por último eliminar Registros. Después de realizar los Procesos de Creacion, Modificacion y eliminacion se debe actualizar la informacion.
en la division y la resta las variables van al reves