Dia Mejor

Practica 2.1 windows

Author: Moises





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;
namespace Practica2_problema1_windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btPromedio_Click(object sender, EventArgs e)
{
textBox1.Focus();
double ca1, ca2, ca3, ca4, pro;
ca1 = double.Parse(textBox1.Text);
ca2 = double.Parse(textBox2.Text);
ca3 = double.Parse(textBox3.Text);
ca4 = double.Parse(textBox4.Text);
pro=(ca1+ca2+ca3+ca4)/4;
if (pro < text =" pro.ToString();" text =" pro.ToString(">= 70 && pro <= 100) { textBox5.Text = pro.ToString(); textBox6.Text = pro.ToString("Aprobaste"); } else { MessageBox.Show("No puedes sacar mas de 100!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading MessageBoxOptions.RightAlign); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); textBox1.Focus(); } } private void btLimpiar_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); textBox1.Focus(); } private void btSalir_Click(object sender, EventArgs e) { Close(); } } }

 

0 Response to “Practica 2.1 windows”

Leave a Reply