jueves, 15 de octubre de 2009

PRACTICA 5.2 D

CONSOLA


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._2D_console
{
class Program
{
static void Main(string[] args)
{
int c1, er;
c1 = 0;
er = 0;
do
{
Console.WriteLine(" \n Introduce Calificacion");
c1 = int.Parse(Console.ReadLine());
if (c1 <> 100)
{
er = er + 1;
}
}
while (er <>



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._2D_windows
{
public partial class Form1 : Form
{
int c1, er;
public Form1()
{
c1 = 0;
er = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
listBox1.Items.Add(c1.ToString());
er = er + 1;
}
else
{
listBox1.Items.Add(c1);
}
if (er > 5)
{ Close(); }
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}

No hay comentarios:

Publicar un comentario