For some reason when I run the program I output hexidecimals. Can anyone help me with this and point me in the right direction?Code:#include <iostream>#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
// Function Prototypes
void getInput(string varray[], string vitamin, double parray[], double price, int qarray[], int quantity);
void totalValue(double price, int quantity, double totalvalue);
void averageValue(double price, int quantity, double avgValue);
void printTable(string varray[], string vitamin, double parray[], double price, int qarray[], int quantity, double totalvalue);
int main()
{
// Declares the variables.
string vitamin;
double price, totalvalue, avgValue;
int quantity, size;
// Sets the array sizes to 3.
string Varraysize[3] = {};
double Parraysize[3] = {};
int Qarraysize [3] = {};
// Function Calls
getInput(Varraysize, vitamin, Parraysize, price, Qarraysize, quantity);
totalValue(price,quantity, totalvalue);
averageValue(price,quantity,avgValue);
printTable(Varraysize, vitamin, Parraysize, price, Qarraysize, quantity, totalvalue);
cout<< endl;
// Outputs the average price and final inventory of the arrays.
cout << endl;
cout << "The average price for a vitamin is: $" << avgValue << endl;
//cout << "The total store inventory is: " <<
return 0;
}
// Functions!
void getInput(string varray[], string vitamin, double parray[], double price, int qarray[], int quantity)
{
int i;
for ( i = 0; i < 3; i++)
{
cout <<"Enter the vitamin name: " <<endl;
cin >> vitamin;
vitamin = varray[i];
cout << endl;
cout << "Enter the price of the vitamins: " << endl;
cin >> price;
price = parray[i];
cout << endl;
cout << "Enter the quantity of vitamins you wish to purchase: " << endl;
cin >> quantity;
quantity = qarray[i];
cout << endl;
}
}
void totalValue(double price, int quantity, double totalvalue)
{
totalvalue = price*quantity;
//cout <<"The total value of your vitamins is: "<<totalvalue<<endl;
cout << endl;
}
void averageValue(double price, int quanity, double avgValue)
{
avgValue = price;
}
void printTable(string varray[], string vitamin, double parray[], double price, int qarray[], int quantity, double totalvalue)
{
cout << setw(10) << left << "Vitamin";
cout << setw(10) << left << "Price";
cout << setw(12) << left << "Inventory";
cout << setw(12) << left << "Total value of inventory \n";
cout << "______________________________________________________________________" << endl;
cout <<setw(10) << left << vitamin;
cout <<setw(10) << left << price;
cout <<setw(12) << left << quantity;
cout <<setw(12) << left << totalvalue;
}