Find Jobs
Hire Freelancers

restaurant

$20-25 USD

完了済み
投稿日: 約22年前

$20-25 USD

完了時にお支払い
The problem is to simulate a sales operations in McM's. In this problem you will write a program to simulate customers being served in favorite fast food restaurant. The maximum configuration of the establishment will be on the first line of input. It will determine the number of drive though lanes and the number of registers serving the people in the restaurant. Initially all registers are closed i.e. no customer will be served before one has been opened. A register (or a drive through lane) can be activated or closed at any time, you decide when. These changes of status will take effect on the following time unit. When a register is opened a line (queue) is to be created for the people waiting to be served, and two other queues for the people who have purchased their meal, but have not been served yet, to wait for their meal. There will be one of these wait queues for each of the drive through lanes. There is no limit to the length of the queues in which people are waiting to be served, but each queue where people are waiting for their order can only have 3 customers at any time, with the exception of the drive through lanes which can handle 4 customers. Each sales person can serve one customer at any time unit. A sales person who is taking care of one of the drive through lanes has to also take care of one of the registers. This forces the person to decide, who to service next, the drive through or the restaurant queue. At the time of sale the customer will decide how many items they will order. The wait time for the order is 3 time units per item. In the simulation the number of items will be determined by a random number generator. At most 10 items per purchase. We will talk about the random number generator and seeding it in the class on Monday April 15. In this simulation an arbitrary number of customers will enter the restaurant at any time unit. You will know whether they come into the restaurant or enter a drive through lane. Each of them will need to be assigned a unique customer number and be placed into one of the queues, which one is up to you. A customer cannot be placed into the drive though lane queue unless he/she is a drive though customer and same applies to in restaurant customers. ## Deliverables Any time unit an open register or an open drive though lane can process single order as long as there is room in one of the order wait queues for that register or drive through lane. Be smart on how you place customers into queues, if there is extra wait the customers are not happy and will be lost. They will not want to wait more than 25 time units and if they have waited over 15 time units they are unhappy about the service. Once a customer is within the next three to be served, the line the customer is waiting cannot be changed. If the line is changed the customer will have to enter at the end of the line. For every register that is open for sales, but does no sales for more than 2 time units, it will cost one sale for every time unit past two that it does no sales. (NO penalty if the register is held up because the wait lines are full.) Your job is to design a queuing system that will serve as many people as possible and as few people as possible will leave without eating and of course maximize the number of sales. Commands and the data will come from stdin, and output will go to stdout. The input line can contain any of the following info: First line - three numbers: 2 7 1234 2 - maximum number of drive through lanes 7 - maximum number of in restaurant registers 1234 - value to use to seed the random number generator Rest of the lines - two numbers and an optional command: 1 8 p 1 - a single customer enters into drive though lanes 8 - 8 customers entered the restaurant and are to be placed into queues p - if a p is present at the end of the line, print out the content of all queues in a nice understandable format Output from the p commad needs to include the customer sequence number and the number of time units the customer has waited for service. The simulation ends after the last line of input has been processed. The last line of the input will contain -1 -1. At this time you are to print out the content of the queues and final statistics: total number of customers total number of items sold number of customers served in restaurant number of customers served in drive though lane number of unhappy customers number of customers that left without getting served number of customers that switched queues total number of item costs lost due to the extra registers being open average time a customer waited before ordering average time a customer waited after ordering Part of this assignment is a Makefile which builds an executable called mcm ## Platform c++(unix based g++)
プロジェクト ID: 2847017

プロジェクトについて

7個の提案
リモートプロジェクト
アクティブ 22年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
アワード者:
ユーザーアバター
See private message.
$12 USD 14日以内
5.0 (35 レビュー)
4.3
4.3
この仕事に7人のフリーランサーが、平均$19 USDで入札しています
ユーザーアバター
See private message.
$21.25 USD 14日以内
4.4 (72 レビュー)
5.5
5.5
ユーザーアバター
See private message.
$21.25 USD 14日以内
5.0 (43 レビュー)
4.8
4.8
ユーザーアバター
See private message.
$21.25 USD 14日以内
5.0 (9 レビュー)
2.5
2.5
ユーザーアバター
See private message.
$21.25 USD 14日以内
5.0 (3 レビュー)
1.1
1.1
ユーザーアバター
See private message.
$21.25 USD 14日以内
5.0 (4 レビュー)
0.4
0.4
ユーザーアバター
See private message.
$12.75 USD 14日以内
0.0 (1 レビュー)
0.9
0.9

クライアントについて

ROMANIAのフラグ
Romania
5.0
1
メンバー登録日:4月 17, 2002

クライアント確認

このクライアントからの他の仕事

mcm_restaurant
$20-25 USD
ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。