Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define ELEMENTOS 10
- using namespace std;
- /*Estructuras que tienen como miembros otras estructuras. Ayudan a tener la estrutura de datos más organizada*/
- struct estruc_existencias
- {
- int cintas, cd;
- };
- struct estruc_proveedor
- {
- char nombre_proveedor[40], telefono_proveedor[10], direccion_proveedor[100];
- };
- struct estruc_inventario
- {
- char titulo[30], autor[40];
- //Se define la llave de estruc_existencias y estruc_proveedor dentro de estruc_inventario para anidarlas
- struct estruc_existencias existencias[ELEMENTOS];
- struct estruc_proveedor proveedor[ELEMENTOS];
- }inventario[ELEMENTOS];
- int tomar_datos(struct estruc_inventario inventario)
- {
- cout << "¿Cuántos proveedores desea almacenar en el sistema?" << endl;
- int num_proveedores;
- for (int i = 0; i < num_proveedores; i++)
- {
- cout << "Nombre del proveedor" << endl;
- //Se necesitan varios inventarios!! anidar en ciclo for, pero del proveedor sí se pueden tener varios proveedores
- cin >> inventario[i].proveedor[i].nombre_proveedor;
- cout << "Teléfono del proveedor" << inventario.proveedor[i].nombre_proveedor << endl;
- cin >> inventario.proveedor[i].telefono_proveedor;
- cout << "Dirección del proveedor" << inventario.proveedor[i].nombre_proveedor << endl;
- cin >> inventario.proveedor[i].direccion_proveedor;
- cout << "¿El proveedor " << inventario.proveedor[i].nombre_proveedor << "suministra cintas? Si es así, digite el número suministrado. En caso contrario, digite 0" << endl;
- int num_cintas;
- inventario.existencias[i].cintas += num_cintas;
- do
- {
- for (int i = 0; i < num_cintas; i++)
- {
- }
- } while (num_cintas != 0);
- }
- }
- void main(){
- cout << "Tienda de música\n\n1. Ingresar datos de proveedor\n2. Ver existencias\n3. Ver inventario. ";
- int switch_on;
- cin >> switch_on;
- switch (switch_on)
- {
- case 1:
- tomar_datos(inventario);
- break;
- default:
- break;
- }
- tomar_datos();
- /*
- cout << "nota 1 : " << endl;
- cin >> ptrn->nota1;
- cout << "nota 2 : " << endl;
- cin >> ptrn->nota2;
- cout << "nota 3 : " << endl;
- cin >> ptrn->nota3;
- ptrn = notas;
- */
- system("pause>null");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement