Help needed, array being called into functions and multiplied.

Hey so Ive been working on this for a while now and nothing seems to work. I need to take an array (prices) and let the user enter the percentage that they want to increase the all the prices by. This is what I have came up with so far but for some reason the array doesnt want to multiply. Any help would be amazing, Thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//Intermediate25.cpp - increases the prices stored in an
//array and then displays the increased prices
//Created/revised by <your name> on <current date>

#include <iostream>
#include <iomanip>
using namespace std;


double getIncrease();
void increasePrice(double amount[], double pI);
void displayArray(double amount[], int numElements);

int main()
{
	cout << fixed << setprecision(2);

	//declare array
	double prices[10] = {10.5, 25.5, 9.75, 6.0, 35.0, 100.4, 10.65, .56, 14.75, 4.78};
    double increase = 0.0;
    
    //get input
    increase = getIncrease();
    increasePrice(prices, increase);
    displayArray(prices, 10);

    
	system("pause");
	return 0;
}	//end of main function

/* ++++++++++++++++++++++++++++++++++++++++++++++++++ */
double getIncrease()
{
    double up = 0.0;
    cout << "Enter a percentage in which to increase prices by: % ";
    cin >> up;
    return up;
}// end of GetSales function

 void increasePrice(double amount[], double pI)
{
    for(int i = 0; i > 10; i++)
    {
        amount[i] = amount[i] * pI;
    }//end for statment
}//end of increasePrice Function

void displayArray(double amount[], int numElements)
{
    cout << fixed << setprecision(2) << endl << endl;
    for (int sub =0; sub < numElements; sub +=1)
    {
        cout << "Price of Item " << sub + 1 << " after increase: $";
        cout << amount[sub] << endl;
    }// end for
}// end of displayArray function 
At first glance you don't seem to have declared or initialized the arguments in your global functions
Line 43. Do you really want i > 10 as the control condition?
Topic archived. No new replies allowed.