Академический Документы
Профессиональный Документы
Культура Документы
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Program
{
static void Main(string[] args)
{
// class Nomina//
Console.WriteLine("*****NOMINA*******");
Nomina nomina = new Nomina();
Console.WriteLine("digite el ID Del Empleado");
nomina.id_emplado = Convert.ToInt32(int.Parse(Console.ReadLine()));
nomina.sueldo();
Console.WriteLine("Digite la antiguedad del empleado (aos)");
nomina.iva = int.Parse(Console.ReadLine());
nomina.prima();
nomina.vacaciones();
// class empleado
Console.WriteLine("******EMPLEADO*****");
// class correo
Console.WriteLine("*******CORREO*******");
Correo correo = new Correo();
correo.correo_solucion();
// class vendedor
Console.WriteLine("*******VENDEDOR*******");
int[] prueba = new int[12];
Vendedor hola = new Vendedor(prueba);
// class operarios
Console.WriteLine("******CLIENTE*****");
Operarios op = new Operarios();
op.Imprimir();
}
}
}
CLASE OPERARIOS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Operarios
{
private int[] sueldos;
public Operarios()
{
sueldos = new int[5];
for (int f = 0; f < sueldos.Length; f++)
{
Console.Write("Ingrese el sueldo " + (f + 1) + ": ");
string linea = Console.ReadLine();
sueldos[f] = int.Parse(linea);
}
}
public void Imprimir()
{
Console.WriteLine("Los Sueldos Ingresados.");
for (int f = 0; f < sueldos.Length; f++)
{
Console.WriteLine(sueldos[f]);
}
Console.ReadKey(true);
}
CLASE NOMINA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Nomina
{
private int _Salario, _Moneda, _Iva, _ID_empleado ;
public Nomina()
{
_ID_empleado = 0;
_Iva = 0;
_Salario = 0;
_Moneda = 0;
}
_Iva = iva;
_Salario = salario;
_Moneda = moneda;
}
public void sueldo()
{
int horasT = 0;
double valorH = 0, sueldo = 0, a = 0, b = 0, c = 0, d = 0;
Console.WriteLine("Numero de horas trabajadas ");
horasT = int.Parse(Console.ReadLine());
Console.WriteLine("Valor por hora ");
valorH = int.Parse(Console.ReadLine());
a = horasT - 40;
b = valorH * 2;
c = horasT - 48;
d = valorH * 3;
if (horasT > 40)
{
if (a <= 8)
{
sueldo = (a * b) + (40 * valorH);
Console.WriteLine("Sueldo es :" + sueldo);
}
else
{
sueldo = (c * d) + (8 * b) + (40 * valorH);
Console.WriteLine("Sueldo es :" + sueldo);
}
}
else
{
Console.WriteLine("No se produjo ningun descuento ");
sueldo = horasT * valorH;
Console.WriteLine("Sueldo es : " + sueldo);
}
}
public void prima()
{
int prima = 1;
int valorH = 700000 ;
Console.WriteLine("la prima calculada segun el sueldo y la antiguedad
del empleado es : " + prima * valorH);
}
public void vacaciones()
{
int vacaciones = 30;
int segun_aos = 1;
vacaciones = (vacaciones * segun_aos);
Console.WriteLine("las vacaciones calculadas son : " + vacaciones *
segun_aos + " dias ");
}
}
}
CLASE VENDEDOR
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Vendedor
{
string nombreVendedor;
int sumatorio = 0;
int decision;
public Vendedor(int[] ventasMes)
{
Console.WriteLine("*****bienvenido*****");
Console.WriteLine("Ingrese datos de ventas del vendedor:");
Console.WriteLine("Nombre del vendedor:");
nombreVendedor = Console.ReadLine();
for (int i = 0; i < 12; i++)
{
if (i == 11)
{
Console.WriteLine("Las ventas anuales totales del vendedor " +
nombreVendedor + " son : " + sumatorio);
Console.WriteLine("Digite 1 para salir, o 2 para continuar: ");
decision = int.Parse(Console.ReadLine());
if (decision == 2)
{
i = -1;
continue;
}
if (decision == 1)
{
Console.WriteLine("Gran total de ventas registradas: " +
sumatorio);
}
}
}
}
CLASE EMPLEADO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Empleado
{
private int _Identificacion;
private char _Genero;
private string _Nombre, _Apellido, _Dependencia;
_Genero = genero;
_Identificacion = identificacion;
_Nombre = nombre;
_Apellido = apellido;
}
public void Segundo_menu()
{
double ingresoI = 0;
string ingresoN, ingresoA , ingresoD, ingresoH;
char ingresoG;
Console.WriteLine("Digite la identificacion del empleado");
ingresoI= identificacion = int.Parse(Console.ReadLine());
Console.WriteLine("Digite nombre");
ingresoN = nombre = Console.ReadLine();
Console.WriteLine("Digite apellido");
ingresoA = apellido = Console.ReadLine();
Console.WriteLine("Digite genero");
}
}
CLASE CORREO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace POO_Clases_y_Objetos
{
class Correo
{
private string _Enviado_a;
private string _Enviado_por;
private string _Asunto;
{
get { return enviado_a; }
set { _Enviado_a = value; }
}
public string enviado_por
{
get { return enviado_por; }
set { _Enviado_por = value; }
}
public Correo()
{
_Enviado_a = string.Empty;
_Enviado_por = string.Empty;
_Asunto = string.Empty;
}
public Correo(string _Enviado_a,string _Enviado_por, string _Asunto)
{
_Asunto = _asunto;
_Enviado_a = enviado_a;
_Enviado_por = enviado_por;
}
{
string correo,asunto,cuerpo,hola;
Console.WriteLine("digite la direccion de correo ");
correo = Console.ReadLine();
Console.WriteLine("digite el asunto del mensaje ");
asunto = Console.ReadLine();
Console.WriteLine("digite el cuerpo del mensaje");
cuerpo = Console.ReadLine();
Console.WriteLine("digite enviado si desea enviar el mensaje ");
Console.WriteLine("digite cancelado si desea cancelar envio" );
hola = Console.ReadLine();
Console.WriteLine(" correo " + " " + hola + "a"+" " + correo );
}
}