Вы находитесь на странице: 1из 15

CLASE PRINCIPAL PROGRAM

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*****");

Empleado empleado = new Empleado();


empleado.Segundo_menu();

// 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 int salario


{
get { return salario; }
set { _Salario = value; }
}

public int moneda


{
get { return moneda; }
set { _Moneda = value; }
}

public int iva


{
get { return iva; }
set { _Iva = value; }
}
public int id_emplado
{
get { return id_emplado; }
set { _ID_empleado = value; }

public Nomina()
{
_ID_empleado = 0;
_Iva = 0;
_Salario = 0;
_Moneda = 0;
}

public Nomina(int id_emplado, int iva , int salario, int moneda)


{
_ID_empleado = id_emplado;

_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++)
{

Console.WriteLine("Introduzca el monto de ventas del mes:");


ventasMes[i] = int.Parse(Console.ReadLine());

sumatorio = ventasMes[i] + sumatorio;

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;

public int identificacion


{
get { return identificacion; }
set { _Identificacion = value; }
}
public string nombre
{
get { return nombre; }

set { _Nombre = value; }


}
public string apellido
{
get { return apellido; }
set { _Apellido = value; }
}

public char genero


{
get { return genero; }
set { _Genero = value; }
}
public string dependencia
{
get { return dependencia; }
set { _Dependencia = value; }
}
public Empleado()
{
_Identificacion = 0;
_Genero = '\0';
_Nombre = string.Empty;
_Apellido = string.Empty;
_Dependencia = string.Empty;
}
public Empleado(string nombre,string apellido, string dependencia, char
genero , int identificacion)
{
_Dependencia = 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");

ingresoG = genero = Convert.ToChar(Console.ReadLine());


Console.WriteLine("Digite dependencia");
ingresoD = dependencia = Console.ReadLine();

Console.WriteLine("Digite contratar si desea contratar");


Console.WriteLine("Digite liquidar si desea liquidar");
Console.WriteLine("digite autorizar si desea autorizar");
ingresoH = Console.ReadLine();
Console.WriteLine(" empleado " + " "+ ingresoH + " " + ingresoN + "
" + ingresoA + " " + ingresoI + " "+ ingresoG + " " + ingresoD);

}
}

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;

public string enviado_a

{
get { return enviado_a; }
set { _Enviado_a = value; }
}
public string enviado_por
{
get { return enviado_por; }
set { _Enviado_por = value; }
}

public string _asunto


{
get { return _asunto; }
set { _Asunto = 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;
}

public void correo_solucion()

{
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 );

}
}

Вам также может понравиться