We've started learning about arrays, but our lecture notes are really not helpful at all and we don't have a book. I'm struggling to understand this question and I honestly have no idea what to do or where to start. I've tried to read tutorials and things but I'm just not understanding it. If someone could help me step by step with this problem I would be really grateful.
The question:
Create an array of type float with 10 elements. Write a modular program that does the following:
• Read values into the array representing salaries.
• Give everyone a 20% pay rise!
• Display the new salaries.
• Find the largest salary and display this, along with the index where it occurs.
What I've got so far:
#include <stdio.h>
const int SIZE = 10;
/* Read user input */
int getData ()
{
int array[SIZE];
float i;
printf("Enter a salary: %f", i);
scanf("%f%*c", &array[i]);
return(i);
}
/* Calculate pay rise */
void PayRise (int pay)
{
pay = i*.2
return;
}
/* Find the largest salary */
max = array[0];
for(i = 1; i < SIZE; i++)
{
if(array[i] > max)
max = array[i];
}
/* Print Results */
void PrintResults(int pay)
{
printf("After a 20% pay rise: ", pay);
printf("The largest salary is: ", max);
return;
}
int main()
{
int array[SIZE];
float i;
int pay;
PrintResults(pay);
return (0);
}