Академический Документы
Профессиональный Документы
Культура Документы
FORM1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ClsProductos
{
public partial class Form1 : Form
{
Bien[] B = new Bien[50];
Servicio[] S = new Servicio[50];
int I, K;
public Form1()
{
InitializeComponent();
}
}
}
}
CLASE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClsProductos
{
public class Producto
{
protected string cod;
protected string nom;
protected float precio;
}
public class Bien:Producto
{
public void ingreso_datos(string c, string n, string p)
{
cod = c;
nom = n;
precio = Convert.ToSingle(p);
}
}
public class Servicio:Producto
{
public void ingreso_datos(string c, string n, string p)
{
cod = c;
nom = n;
precio = Convert.ToSingle(p);
}
}