Problem 4 (20 Points Larry Edison is the Director of the Computer Center for Buc
ID: 2903132 • Letter: P
Question
Problem 4 (20 Points Larry Edison is the Director of the Computer Center for Buckley College. He now needs to schedule the staffing of the center. It is open from 8AM until midnight. Larry has monitored usage of the center at various times of day and determined that the following number of computer consultants are required: Minimum Number of Consultants Required to be on Duty Time of Day -- 8 AM-noon 4 Noon-4 pm 8 4pm-8pm 10 Spin-midnight 6 Two types of computer consultants can be hired: full-time and part-time. The full-time consultants work for eight consecutive hours in any of the three shifts: (8am- 4pm), afternoon (noon-8pm) and evening (4 pm-midnights). Full-time consultants are paid $25 per hour. Pan-time consultants can be hired to work for 4 hours on any of the four shifts listed in the Table. Pan-time consultants are paid $18 per hour. An additional requirement is that during every time period, there must be at least two full-time consultants on duty for every part-time consultant on duty. Larry would like to determine how many full-time and part-time consultants should work each shift to meet the above requirements and minimize the daily personnel cost . Formulate this as an integer programming problem. You must define your variables clearly, write out the constraints with brief explanations and write the objective function to be minimized.Explanation / Answer
public static void main(String[] args){
int cost = 0; // final cost//
int[] array = new int[]; // array of the consultants required to be on duty//
int count = 0;
for(int i=1; i<array.length ; i++){ // for loop//
if (array[i] > array[i-1]){
cost = cost + 25*(array[i-1] - count); // counting how much is the difference between the next hour number of consultants and now//
count = array[i] - array[i-1];
}
else{
if (count == array[i]){ // if the next hour consultants exactly matches to the consultants empty position now return cost//
cost = cost + 25*array[i];
}
else{
cost = cost + 25*array[i] + 18*(array[i-1] - array[i]);
count = 0 ;
}
}
}
System.out.println(cost); // print the minimum cost//
}
In the above case the minimum cost would be
cost = 25*4 + 25*4 + 25*6 = 350$
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.