Docsity

PROTOTIPO código de programacion, Guías, Proyectos, Investigaciones de Ingeniería Industrial

Toggle sidebar
bg1
—-----------------------------------------------------------------------—----------------------------------------------
PROTOTIPO
POR:
●ANDREW ELLIOT ACUÑA NIÑO DE GUZMÁN
●JOSE LEONARDO CRUZ GONZALES
●MARCELO GABRIEL GUEVARA REYES
—-----------------------------------------------------------------------—----------------------------------------------
#include <iostream>
#include <vector>
#include <time.h>
using namespace std;
vector<string> Fechas_Ingreso;
vector<string> Fechas_Salida;
vector<string> Tipos;
vector<string> Nombres;
vector<string> Identificaciones;
string Fecha_Ingreso,Fecha_Salida,Tipo,Nombre;
int opcion;
void Reguistrar_Producto(){
cout<<"Ingresar fecha de ingreso: ";
cin>>Fecha_Ingreso;
Fechas_Salida.push_back(Fecha_Ingreso);
cout<<"Ingresar fecha de salida: ";
cin>>Fecha_Salida;
Fechas_Ingreso.push_back(Fecha_Salida);
cout<<"Ingresar el tipo: ";
cin>>Tipo;
Tipos.push_back(Tipo);
cout<<"Ingresar el nombre: ";
cin>>Nombre;
Nombres.push_back(Nombre);
}
void Generar_Identificacion(){
string identificacion;
identificacion += Nombre[0];
identificacion += Tipo[0];
pf3

Vista previa parcial del texto

¡Descarga PROTOTIPO código de programacion y más Guías, Proyectos, Investigaciones en PDF de Ingeniería Industrial solo en Docsity!

PROTOTIPO

POR:

● ANDREW ELLIOT ACUÑA NIÑO DE GUZMÁN

● JOSE LEONARDO CRUZ GONZALES

● MARCELO GABRIEL GUEVARA REYES

#include #include #include <time.h> using namespace std; vector Fechas_Ingreso; vector Fechas_Salida; vector Tipos; vector Nombres; vector Identificaciones; string Fecha_Ingreso,Fecha_Salida,Tipo,Nombre; int opcion; void Reguistrar_Producto(){ cout<<"Ingresar fecha de ingreso: "; cin>>Fecha_Ingreso; Fechas_Salida.push_back(Fecha_Ingreso); cout<<"Ingresar fecha de salida: "; cin>>Fecha_Salida; Fechas_Ingreso.push_back(Fecha_Salida); cout<<"Ingresar el tipo: "; cin>>Tipo; Tipos.push_back(Tipo); cout<<"Ingresar el nombre: "; cin>>Nombre; Nombres.push_back(Nombre); } void Generar_Identificacion(){ string identificacion; identificacion += Nombre[0]; identificacion += Tipo[0];

Identificaciones.push_back(identificacion); cout << endl << identificacion; } void Mostrar_Producto(const string& identificacion) { int indice = -1; for (int i = 0; i < Identificaciones.size(); ++i) { if (Identificaciones[i] == identificacion) { indice = i; break; } } if (indice != -1) { cout << "Fecha de ingreso: " << Fechas_Ingreso[indice] << endl; cout << "Fecha de salida: " << Fechas_Salida[indice] << endl; cout << "Tipo: " << Tipos[indice] << endl; cout << "Nombre: " << Nombres[indice] << endl; } else { cout << "No se encontró ningún producto con la identificación proporcionada." << endl; } } void Menu_Principal(){ do { cout << "\n ======================== INVENTARIO =========================== \n" << endl; cout << "[1]. Ingresar producto \n" << endl; cout << "[2]. Mostrar producto \n" << endl; cout << "[3]. Salir \n" << endl; cout << "\n =============================================================== \n" << endl; cout << "Ingrese una opción [1] o [2] o [3]: "; cin >> opcion; switch (opcion) { case 1:{ Reguistrar_Producto(); Generar_Identificacion(); cout << "Producto ingresado correctamente." << endl; break; } case 2:{ string identificacion; cout << "Ingrese la identificación del producto: "; cin >> identificacion; Mostrar_Producto(identificacion); break; } case 3:{