Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Matlab solve the following problem A restaurant manager wants to know how man

ID: 3758440 • Letter: I

Question

In Matlab solve the following problem

A restaurant manager wants to know how many employees are needed at the restaurant each hour of the day. The minimum number of employees needed at any hour is 3. After that, one additional employee is required for each 20 customers. The restaurant is open 24 hours a day. The manager has counted the number of customers each hour for 14 days. The manager will use the average number of customers for each hour over the 14 days to calculate the needed number of employees for each hour. Develop a solution to output the needed number of employees per hour. (There is no such thing as a partial employee.)

Explanation / Answer

#Begin Code
#$var will contain the number that the manager will input
$var = shift;
#The problem states a min of 3 employees
$min_employee = 3;
#Here, we divide the number that the manager will input
#to find out how many additional employees we will need
$needed_employee = ($var / 20);
#This outputs the number that we calculated
#Though, I would suggest that this line be left out
#Since the problem didn't ask for it
print ';original num is $needed_employee ';;
#Here we say that if the number of employees that we need
#is greater than zero, then we will add three
if ($needed_employee %26gt; 0){
#This is to obtain only the digits before the period
#It is to satisfy the statement ';There is no such thing as
#partial employee';
$needed_employee =~ m/([^*.])/;
$needed_employee = $1 + $min_employee;
print ';Needed Employee = $needed_employee ';;}
else{
#If we get anything less than one; say .90 then
#we just default to the min number of employees
print ';Needed Employee = $min_employee ';;
}
#End Code

Here is example output....
--------------------------------------?br>
As you can see here, we input 19 people and PERL tells us that we need 3 since it is the min.
perl abs.pl 19
original num is 0.95
Needed Employee = 3
--------------------------------------?br>
Here, we input 20 and PERL says we need the 3 min employee plus 1 more since we reached 20. The total now becomes 4.
perl abs.pl 20
original num is 1
Needed Employee = 4
--------------------------------------?br>
and so on and so on........
perl abs.pl 40
original num is 2
Needed Employee = 5
perl abs.pl 59
original num is 2.95
Needed Employee = 5
perl abs.pl 60
original num is 3
Needed Employee = 6

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote