First thank you to all the people who replied in my previous post: SimonRev, Igor Tandetnik.
I am new to programming, so please excuse my lack of technical terms and knowledge in this subject. I wrote a program, it only took me like 4 days...hahaha. I now have to integrate a loop into the program. I am just not sure where it should go, or how to go about doing it.
Any input, advice would be greatly appreciated. Please see my code below.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
float sentry(void)
{
float s;
printf("Please enter the salary of your Employee:");
scanf("%f", (&s));
return s;
}
float raises(float s)
{
if (s>0 && s<30000)
return .07;
else if (s>30000 && s <= 40000)
return .055;
else if (s>40000)
return .04;
}
void print(float salary, float incr)
{
printf("Initial salary : %.2f\n", salary);
printf("Increase : %.2f %%\n", incr * 100);
printf("Raise amount : %.2f\n", salary * incr);
printf("New Salary : %.2f\n", salary + (salary * incr));
}
int main(void)
{
float salary;
float incr;
printf("Salaries and raises calculator\n\n");
salary = sentry();
incr = raises(salary);
print(salary, incr);
system("pause");
}