I am writing a program to calculate the amount of employees needed per hour based on the amount of customers. There must be at least 3 employees at all times, but also 1 additional employee per 20 customers. I wrote this with arrays and for loops, but after I enter all my values of customers per hour (I have just been using 9, 10, 19, 20, 29, 30.... for number customers) and try to print the results it breaks. I am not sure why.... please help. THANK YOU
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// Program to calculate how many employees are needed during the day based on customers
//for loop to gather information and calculate employees
for (i=0; i <= 24; i++)
{
cout << "Please enter the amount of customers for the time period of " << hours[i] << ":" << endl;
cin >> customers[i];
employees[i] = 3 + customers[i] / 20;
}
//for loop to print results
for (i=0; i <= 24; i++)
{
cout << "The amount of employees needed to cover certain time periods is as fallows:"<< endl << endl;
cout << "For the timme period of "<< hours[i] << " you will need " << employees[i] << " employees." << endl;