Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PRESENTADO POR:
CODIGO: 1017125414
TUTOR:
CURSO:
INTRODUCCION A LA PROGRAMACION
GRUPO: 301304_82
MEDELLIN
El lenguaje de programación C es uno de los más utilizados (si no el que más) en la programación
de sistemas software. Es similar a Python en muchos aspectos fundamentales: presenta las mismas
estructuras de control (selección condicional, iteración), permite trabajar con algunos tipos de datos
similares (enteros, flotantes, secuencias), hace posible definir y usar funciones, etc. No obstante,
en muchas otras cuestiones es un lenguaje muy diferente. C presenta ciertas características que
permiten ejercer un elevado control sobre la eficiencia de los programas, tanto en la velocidad de
información explícita sobre gran cantidad de detalles, aumentando así la probabilidad de que
cometamos errores.
TABLA DE REQUERIMIENTOS
DISEÑO DE CLASES
Clase Atributos
AtributosEmpleados
int identificacion;
string nombre;
int sueldo;
string nivelFormación;
int antiguedad;
double porcentajeReconocimiento;
string postgrado;
string fecha;
class registro atributosEmpleados[] registros;
int contador;
int contadorMax;
CODIGO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tecer_taller_2019_problema_2
{
class atributosEmpleados
{
int identificacion;
string nombre;
int sueldo;
string nivelFormación;
int antiguedad;
double porcentajeReconocimiento;
string postgrado;
string fecha;
public atributosEmpleados(int identificacion, string nombre, int sueldo, string nivelFormación, int
antiguedad, double porcentajeReconocimiento, string postgrado, string fecha)
{
this.identificacion = identificacion;
this.nombre = nombre;
this.sueldo = sueldo;
this.nivelFormación = nivelFormación;
this.antiguedad = antiguedad;
this.porcentajeReconocimiento = porcentajeReconocimiento;
this.postgrado = postgrado;
this.fecha = fecha;
}
public string getFecha()
{
return fecha;
}
return sueldo;
}
return identificacion;
}
return nombre;
}
public string getNivelFormación()
{
return nivelFormación;
}
return antiguedad;
}
return msj;
}
class registro
{
atributosEmpleados[] registros;
int contador;
int contadorMax;
public void agregar(int identificacion, string nombre, int sueldo, string nivelFormación, int
antiguedad, double porcentajeReconocimiento, string postgrado, string fecha)
{
registros[contador] = new atributosEmpleados(identificacion, nombre, sueldo, nivelFormación,
antiguedad, porcentajeReconocimiento, postgrado, fecha);
contador++;
}
public int buscar(int identificacion) // Con esto aseguramos que cada registro ocupe el puesto que
debe pertenercel
{
int bandera = -1;
for (int i = 0; i < contador; i++)
{
if (registros[i].getIdentificacion().Equals(identificacion))
{
bandera = i;
break;
}
}
return bandera;
}
public int evaluar()
{
int evaluar = 0;
return evaluar;
}
Console.WriteLine("" + registros[i].toString());
}
}
}
class Program
{
Console.WriteLine("Digite su nombre");
nombre = (Console.ReadLine());
Console.WriteLine(" ");
Console.WriteLine(" ");
opNivelF = int.Parse(Console.ReadLine());
switch (opNivelF)
{
case 1:
nivelFormación = "Profesional";
break;
case 2:
nivelFormación = "No es profesioanl, por lo tanto no puedes acceder al beneficio";
break;
}
Console.WriteLine(" ");
Console.WriteLine("Nivel de formación a la cual puedes acceder");
Console.WriteLine("1.Especialización");
Console.WriteLine("2.Maestria");
Console.WriteLine("3.Doctorado");
Console.WriteLine(" ");
Console.WriteLine("Digite la capacitación a la cual quieres acceder");
op = int.Parse(Console.ReadLine());
switch (op)
{
case 1:
postgrado = "Especialista";
if (cantidadS > 1 && cantidadS < 3)
{
porcentaje = 0.005;
break;
case 2:
postgrado = "Maestria";
break;
case 3:
postgrado = "Doctorado";
break;
}
sueldo = sueldo * cantidadS;
porcentajeReconocimiento = sueldo * porcentaje;
else
{
Console.WriteLine("El registro ya se encuetra agregado");
}
else
{
Console.WriteLine("Capacidad Excedida");
}
do
{
menu();
op = int.Parse(Console.ReadLine());
switch (op)
{
case 1:
Console.Clear();
agregar();
Console.ReadLine();
break;
case 2:
Console.Clear();
Console.WriteLine("Información de los trabajadores");
registros.evaluar();
Console.ReadLine();
break;
}
}
}
}
OPERACIONES BASICAS
3. CODIGO
using System;
using System.Collections.Generic;
using System.Linq;
using System. Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int NUM1, NUM2, RESUL;
string linea;
Console.Write("PRIMER NÚMERO :");
linea = Console.ReadLine();
NUM1 = int.Parse(linea);
Console.Write("SEGUNDO NÚMERO :");
linea = Console.ReadLine();
NUM2 = int.Parse(linea);
Console.WriteLine();
RESUL = NUM1 + NUM2;
Console.WriteLine("LA SUMA ES {0}: ", RESUL);
RESUL = NUM1 - NUM2;
Console.WriteLine("LA RESTA ES: {0} - {1} = {2} ", NUM1, NUM2, RESUL);
RESUL = NUM1 * NUM2;
Console.WriteLine("LA MULTIPLICACIÓN ES: " + RESUL);
RESUL = NUM1 / NUM2;
Console.WriteLine("LA DIVISIÓN ES: " + RESUL);
RESUL = NUM1 % NUM2;
Console.WriteLine("EL RESIDUO ES: " + RESUL);
Console.Write("Pulse una Tecla:"); Console.ReadLine();
}
4. GRABAR Y EJECURTAR
COMPRA EN RESTAURANTE
Grabar y ejecutar
FORMATOS DE SALIDA
CODIGO:
using System.Text;
namespace ConsoleApplication1
{ class Program
{ static void Main(string[] args)
{ double BASE, ALTURA, RESUL;
string linea;
Console.Write("DIGITE LA BASE :"); linea = Console.ReadLine();
BASE = double.Parse (linea);
Console.Write("DIGITE LA ALTURA:"); linea = Console.ReadLine();
ALTURA= double.Parse (linea);
RESUL = (BASE * ALTURA) / 2;
Console.WriteLine("AREA TRIANGULO :" + String.Format("{0:####.00}", RESUL));
Console.WriteLine("AREA TRIANGULO :" + String.Format("{0:c}", RESUL));
Console.WriteLine("AREA TRIANGULO :" + String.Format("{0:f}", RESUL));
Console.WriteLine("AREA TRIANGULO :" + String.Format("{0:g}", RESUL));
Console.WriteLine();
Console.WriteLine("HOY ES: " + String.Format("Hoy es {0:F}", DateTime.Now));
Console.WriteLine("HOY ES: " + String.Format("Hoy es {0:dddd}{0:dd/MM/yyy}",
DateTime.Now));
Console.Write("Pulse una Tecla:"); Console.ReadLine();
}
}
}
Grabar y ejecutar
Bibliografias
https://www.mheducation.es/bcv/guide/capitulo/8448147227.pdf
de http://hdl.handle.net/10596/22351
Ceballos, S. F. J. (2007). Microsoft C#: lenguaje y aplicaciones (2a. ed.). (pp. 161 - 204). Madrid,
ES: RA-MA Editorial. Recuperado
dehttp://bibliotecavirtual.unad.edu.co:2077/lib/unadsp/reader.action?docID=11046613&ppg=183
OVI Unidad 3 Arreglos
Benavides, M. (2016). Arreglos. [Video] Recuperado dehttp://hdl.handle.net/10596/10402