Good evening I am finishing a program for the faculty and I am missing a part of the code to multiply a matrix by a vector, in this case it would be the multiplication of the quantity vector [i] [j] * prices [j]. (In the code is an attempt at multiplication but it does not work), if someone can give me some help, I would be very grateful, thank you very much. Here I leave the code walking.
#include<iostream>
using namespace std;
int main()
{
int cantidad[3][5], precios[5], recaudacion[5], i, j, total;
string nombresArticulos[5];
//ingreso e imprime los nombres de los articulos
i=0;
while(i<5)
{
cout<<"Ingrese los nombres de los articulos:"<<endl;
cin>>nombresArticulos[i];
i++;
}
for(i=0; i<5; i++)
{
cout<<nombresArticulos[i]<<endl;
}
//guarda los precios de cada articulo
for(j=0; j<5;j++)
{
cout<<"Ingrese precios de cada articulo"<<endl;
cin>>precios[5];
}
//ingreso de la cantidad de articulos vendidos por cada vendedor
cout<<"Ingrese la cantidad de articulos vendidos por cada vendedor: "<<endl;
for(i=0; i<3; i++)
{
for(j=0; j<5; j++)
{
cout<<"Vendedor: "<<i+1<<" "<<"Articulo: "<<j+1<<endl;
cin>>cantidad[i][j];
}
}
for(i=0; i<3; i++)
{
for(j=0; j<5; j++)
{
//cout<<"Vendedor: "<<i+1<<" "<<"Articulo: "<<j+1<<endl;
cout<<cantidad[i][j]<<endl;
}
}
//cantidad de dinero recaudado por cada vendedor
for(i=0; i<3; i++)
{
for(j=0; j<5; j++)
{
recaudacion[j]=cantidad[i][j]*precios[j];
}
}
for(j=0; j<5; j++)
{
cout<<recaudacion[j]<<endl;
}
}