lunes, 12 de octubre de 2009

PRACTICA 5.2 A

FLUJO



CONSOLA


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PRACTICA_5._2_COSNOLE
{
class Program
{
static void Main(string[] args)
{
int C1;
C1 = 0;
do
{
Console.WriteLine("\nINTRODUZCA LA CALIFICACION");
C1 = int.Parse(Console.ReadLine());
Console.WriteLine("\nCalificacion=\t{0}", C1);
}
while (C1 >= 0 && C1 <= 100); Console.ReadLine(); } } }


WINDOWS









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 practica_5._2_windows
{
public partial class Form1 : Form
{
int c1;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
textBox1.Enabled = false;
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}



No hay comentarios:

Publicar un comentario