Programacion En C#
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;usingSystem.Text;using System.Windows.Forms;namespace cantidad_comprada{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private voidForm1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { double des = .35, tot = 0, compra = 0, cal =0; compra = Convert.ToDouble(textBox1.Text); tot = compra * des; cal = compra - des; textBox2.Text = des.ToString(); textBox3.Text =cal.ToString(); } }} |
Programa numero secreto
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;usingSystem.Text;using System.Windows.Forms;namespace numero_secreto{ public partial class Form1 : Form { int alea = 0; public Form1() { InitializeComponent(); }private void label1_Click(object sender, EventArgs e) { } private void label1_Click_1(object sender, EventArgs e) { } private void button2_Click(object sender,EventArgs e) { int num = 0; label1.Text = alea.ToString(); label1.Visible = true; textBox1.Enabled = false; button2.Enabled = false;num = Convert.ToInt16(textBox1.Text); if (num == alea) { label3.Text = "GANASTE =D"; } else {label3.Text="PERDEDOR"; } label3.Visible=true; button3.Enabled=true; } private void button1_Click(object sender, EventArgs e) { Random x = new...
Regístrate para leer el documento completo.