Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Articulo{
- public:
- string referencia;
- string nombre;
- int existente;
- int compra;
- int venta;
- void capturar();
- void mostrar();
- void buscar();
- };
- void Articulo::capturar(){
- cout<<"t***INGRESAR ARTICULO NUEVO***n"<<endl;
- cout<<"NOMBRE DEL ARTICULO: ";cin>>nombre;
- cout<<"CANTIDAD EXISTENTE: ";cin>>existente;
- cout<<"PRECIO DE COMPRA: ";cin>>compra;
- cout<<"PRECIO DE VENTA: ";cin>>venta;
- cout<<endl;
- cout<<"tREGISTRO COMPLETADO CORRECTAMENTEn"<<endl;
- system("PAUSE");
- };
- void Articulo::mostrar(){
- system("CLS");
- cout<<"***DATOS CAPTURADOS***"<<endl<<endl;
- cout<<"NOMBRE DEL ARTICULO: "<<nombre;
- cout<<endl;
- cout<<"CANTIDAD EXISTENTE: "<<existente;
- cout<<endl;
- cout<<"PRECIO DE COMPRA: "<<compra;
- cout<<endl;
- cout<<"PRECIO DE VENTA: "<<venta;
- cout<<endl;
- };
- void Articulo::buscar(){
- string nombre2;
- cout<<"Escriba el nombre del articulo que desea buscar: ";
- cin>>nombre2;
- if(nombre2==nombre)
- {
- cout<<"ARTICULO ENCONTRADO"<<endl<<endl;
- Articulo datos2;
- datos2.mostrar();
- }
- else
- {
- cout<<"EL ARTICULO NO EXISTE"<<endl;
- }
- }
- int main(){
- Articulo datos;
- Articulo datos1;
- Articulo datos2;
- int opcion;
- opcion=0;
- do{
- cout<<"n t***MEN351 PRINCIPAL***n"<<endl<<endl;
- cout<<" 1.CAPTURAR n";
- cout<<" 2.MOSTRAR n";
- cout<<" 3.BUSCAR n";
- cout<<" 4.Salir n";
- cout<<"Eliga una opci242n: ";
- cin>>opcion;
- switch(opcion){
- case 1:
- system("CLS");
- datos.capturar();
- system("PAUSE");
- system("CLS");
- break;
- case 2:
- system("CLS");
- datos1.mostrar();
- system("PAUSE");
- system("CLS");
- break;
- case 3:
- system("CLS");
- datos2.buscar();
- system("PAUSE");
- system("CLS");
- break;
- case 4:
- cout<<"tFIN DEL PROGRAMAn";
- opcion = 4;
- break;
- default:
- cout<<"tE R R O Rn";
- system("PAUSE");
- system("CLS");
- break;
- }
- }while(opcion != 4);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement