I have a program in C to stdin products and according prices, and the program calculates and applies user input discount to all of the standard prices, however, I have 2 problems with my codebelow: ``` int ReadArray(float arr[]) { int size = sizeof arr[MAX_SIZE] / sizeof *arr; return size; }
int GetIntInRange(int min, int max)
{
int num;
do
{
printf("> ");
scanf("%d", &num);
if (num < min || num > max)
printf("\nRetry! Input must be in between %d and %d\n", min, max);
}
while (num < min || num > max);
getchar();
return num;
}
float DiscountCalculation(float discountPercent, float regPrice)
{
float salesPrice;
salesPrice = regPrice * (1 - discountPercent / HUNDRED);
return salesPrice;
}
void ShowBrandsAndPrices(char *brands[], float prices[], int len)
{
int i;
for (i = 0; i < len; i++)
{
printf("%s\t%.2f\n", brands[i], prices[i]);
}
}
```
My problem #1: my ReadArray function does not calculate the length of array properly, it only returns the length of 1 array member.
Problem #2: the calculated discounts do not show up. What am I doing wrong here? Any help will be much appreciated.