+ 1

Help me please! c++

I don't know how to use variables, or how to initialize constructors:( can someone help me please, I'm seeing inheritance Purchase and sale of 2 items. a) To start the sale of the items you must have the initial quantity of said items, the sale price of the items are $ 110.00 and $ 120.00. The system prints the following menu: a.- Sale of item b.- Item return c.- See existence and amount of sale. d.- Exit. Make a constructor that allows you to set the initial quantity of existence of the articles, the other member variables of the class They must be initialized to 0. Section "a" will ask which item is sold and how many are sold from main (), a method is executed which decreases the existence of the corresponding item and the sale amount is updated.

4th Dec 2020, 11:38 PM
Stpr
6 Respuestas
+ 6
Stpr In the course of c++ itself it's already present! So ig after completing that lesson you will be able to solve the issue
5th Dec 2020, 7:18 AM
Piyush
Piyush - avatar
+ 5
Stpr can you show us what you have done so far ( in terms of progress with this code) ?
5th Dec 2020, 1:15 AM
Arsenic
Arsenic - avatar
0
I know some things but they are very long I assumed that I could see a simpler way with variables and arrangements, so I ask for help i mean i have some of the code and im still confused
5th Dec 2020, 12:17 AM
Stpr
0
Arsenic, I have a process but it is in Spanish and I did another class but in that I have no doubts #include<iostream> #include<string.h> using namespace std; class Venta /**Clase base*/ { protected: int precio[2]; int cant[2]; int i; public: Venta(int C1,int C2); }; class Articulos : public Venta /**Clase derivada*/ { protected: int monto[2]; int i; public: Articulos(int Ca1,int Ca2); void ventArt(int cant[]); void devol(int cant[]); void mostrar(); }; class Proveedor : public Venta /**Clase derivada*/ { private: int montoCompra[2]; int VecesProveedor[3]; int i; public: Proveedor(int Cp1[],int Cp2[]); void artProvee(int Provee ,int cant[]); void mejorProvee(); void mostrar(); }; Venta::Venta(int C1,int C2){ precio[0]=110; precio[1]=120; for(i=0;i<2;i++){ this->cant[i]=cant[i]; cant[i]=0; } Articulos::Articulos(int Ca1,int Ca2) { for(i=0;i<2;i++){ monto[0]=0; monto[1]=0; } void Articulos::ventArt(int cant[]){ } void Articulos:devol(int Ca1,int Ca2){ for(i=0;i<2;i++){ } void Aticulos::mostrar(){ for(i=0;i<2;i++){ monto[i]+=precio[i]*cant[i]; }
5th Dec 2020, 5:22 PM
Stpr