You are on page 1of 9

CAT 3 PRESENTSTION

 Presented by :
 Satyam kumar : 21scse1010304
 Saurav kumar : 21scse1010677
 Saubhagya pandey : 21scse1011260
• Q) Hunger Bites is a restaurant serving three items, burgers, fries, and ice cream. It has two employees Anish and Bani who prepare the
items ordered by the clients. Preparation time is 10 minutes for a burger and 2 minutes for an order of Ice cream. An employee can
prepare only one of these items at a time. The fries are prepared in an automatic fryer which can prepare up to 3 portions of fries at a
time and takes 5 minutes irrespective of the number of portions. The fryer does not need an employee to constantly attend to it, and
we can ignore the time taken by an employee to start and stop the fryer; thus, an employee can be engaged in preparing other items
while the frying is on. However, fries cannot be prepared in anticipation of future orders. Hunger Bites wishes to serve the orders as
early as possible. The individual items in any order are served as and when ready; however, the order is completely served only when
all the items of that order are served. The table below gives the orders of three clients and the times at which they placed their orders:

A). Assume that only one client's order can be processed at any given point of time. So, Anish or Bani cannot start preparing a new order
while a previous order is being prepared. At what time is the order placed by Client 1 completely served?
B). Assume that only one client's order can be processed at any given point of time. So, Anish or Bani cannot start preparing a new order
while a previous order is being prepared. At what time is the order placed by Client 3 completely served?
C). Suppose the employees are allowed to process multiple orders at a time, but the preference would be to finish orders of clients who
placed their orders earlier. At what time is the order placed by Client 2 completely served?

D). Suppose the employees are allowed to process multiple orders at a time, but the preference would be to finish orders of clients who placed their orders earlier. Also
assume that the fourth client came in only at 10:35. Between 10:00 and 10:30, for how many minutes is exactly one of the employees idle?
Q1). solution we can see that, the order of Client 1 has 1 burger, 3 portions of fries and one ice cream
Start the fries (They will take 5 mins). While the fries are in progress, one of them can make Ice Cream (2 mins) and another
can start on Burger. After 5 mins are over, Burger still needs 5 minutes more. So, the order will be prepared in 5 + 5 = 10 mins
in total. So, the order will be served at 10:10 .
start

#include <stdio.h>
int main() Int i
{
    int i; true
    printf("enter any no."); i>=20
    scanf("%d",&i);
    if(i>=20) Surving
    printf("surving 1st client",i); Not joining 1 clone
    else
    printf("not surving");
    return 0;
}
stop
Q b). solution we can see that, the order for client 1 got completed at 10:10.
The order for client will start at 10:10. Fries will take 5 mins and while the fries
are getting prepared, Ice cream can be prepared by one of them. So, in total it will
take 5 mins to process the order for Client 2.
We will start the order for Client 3 at 10:15. We will start with the fries first, while
the fries are being prepared, one of them can start with Burger. Burger takes 10
mins, so after the fries are prepared, it will take additional 5 mins for the burger to
get prepared. So, in total in total it will take 10 mins for the processing of the
order of Client 3.
By 10:25, order of Client 3 will be prepared.
FLOW CHART
#include <stdio.h> start
int main()
{
    float i; Int i
    printf("enter any no.");
    scanf("%f",&i);
    if(i>=20.4) true
i>=20.4
    printf("surving 3 client",i);
    else
    printf("not surving"); Surving
    return 0; Not joining 1 clone
}

stop
Q c). Solution

The order for Client 2 will be served by 10:10. Even, Client 1 will

get its order by 10:10 (because of burger)


FLOW CHART
#include <stdio.h> start
int main()
{
    float i; Int i
    printf("enter any no.");
    scanf("%f",&i);
    if(i>=10.05) true
i>=10.04
    printf("surving 2 client",i);
    else
    printf("not surving"); Surving
    return 0; Not joining 1 clone
}

stop
Q d). Solution

As per the timeline, one person will be idle during 2-5, 10-15 and 15-17.
So, 3+5+2 = 10 minutes.
Exactly one person will be idle for 10 minutes.
THANK YOU

You might also like