practica 13.1 consola
PSEUDOCODIGO
double ancho, largo;
public rectangulo()
{
ancho = 0;
largo = 0;
}
public void Asignardatos(float w,float h)
{
ancho=w;
largo=h;
}
public void Asignarancho(float w)
{ancho=w;
}
public void Asignarlargo(float h)
{
largo=h;
}
public double Obtenerancho()
{
return ancho;
}
public double Obtenerlargo()
{
return largo;
}
public double Area()
{
return largo*ancho;
}
public double Perimetro()
{
return 2*(largo+ancho);
}
practica 13.1 windows
practica 13.2 consola
int ide;
double[] calif;
int total;
public estudiante()
{
ide=0;
calif=new FLOAT[5];
total=0;
}
public void introduceide(int nc)
{
ide=nc;
}
public void introducecalif(FLOAT nota)
{
calif[total]=nota;
total++;
}
public FLOAT promedio()
{
double suma=0.0f;
int i;
for i=0 step total i=i+1
{
suma=suma+calif[i];
}
return suma/total;
PRACTICA 13_2 WIN
viernes, 18 de diciembre de 2009
martes, 8 de diciembre de 2009
practicas extra unidad 3
CONSOLA
VISUAL
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double[] valor = { 5, 7, 8, 2, 3 };
int i;
double maximo = valor[0];
double minimo = valor[0];
double intervalo = 0;
for (i = 0; i <> maximo)
{
maximo = valor[i];
}
if (valor[i] < minimo =" valor[i];" intervalo="maximo-minimo;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYrm6_QEFeEYy5XzQ8GFbHP0nYXF3YWeENH75ARRqqQ8crau_pmj-WOwQp4zKi02c4P2h8Xm0H8JbI6D2ZNfHna-fXRLksl4gfiBPkZONtKlvEzo5vOkUmdwEmkYMzJ1uQ8qqRqTjXQGz/s1600-h/med+cuad+visual+2.jpg">CONSOLA SEGUNDO PROBLEMA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EXAMEN2doCONSOLA
{
class Program
{
static void Main(string[] args)
{
int[] valor = new int[5];
int i = 0;
double mgeo = 0;
double total = 0;
Console.WriteLine("introduce los siguientes datos");
for (i = 0; i < total =" Math.Pow(valor[i]," mgeo =" Math.Sqrt(10" i =" 0;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYrm6_QEFeEYy5XzQ8GFbHP0nYXF3YWeENH75ARRqqQ8crau_pmj-WOwQp4zKi02c4P2h8Xm0H8JbI6D2ZNfHna-fXRLksl4gfiBPkZONtKlvEzo5vOkUmdwEmkYMzJ1uQ8qqRqTjXQGz/s1600-h/med+cuad+visual+2.jpg">visual
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 media_geometrica
{
public partial class Form1 : Form
{
int[] x = new int[10];
double multip = 0, GM;
int i = 0;
public Form1()
{
multip = GM = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (i< 10)
{
x[i] = int.Parse(textBox1.Text);
listBox1.Items.Add(x[i]);
textBox1.Clear();
textBox1.Focus();
i++;
}
}
private void button2_Click(object sender, EventArgs e)
{
for (i = 0; i <5; i++)
{
listBox1.Items.Add("dato" + i.ToString() + ": " + x[i].ToString());
multip = Math.Pow(x[i], 5);
}
GM = Math.Sqrt(5 / multip);
listBox1.Items.Add("El valor cuadratico medio es" + GM.ToString());
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Suscribirse a:
Entradas (Atom)