Write a simulation for a burger joint and its customers

Assignment Help C/C++ Programming
Reference no: EM133345269

Operating Systems

Write a simulation for a burger joint and its customers. The burger joint should be implemented as a server application, while the clients should be implemented as client applications connecting to the server application via TCP/IP. The burger joint will have several chefs producing the burgers. Each burger will take some time to be produced and the clients (see customers) will command and eat the burgers if they are available. However, they also will need some time to consume the burgers. The burger joint can produce a certain number of burgers and each client is capable to consume a certain amount of burgers. The simulation stops either when there are no more burgers available or each of the clients consumed the maximum number of burgers they were supposed to eat. If there are still left some burgers (or some of the burgers were not yet prepared by the chefs), the burger joint remains open waiting for possible new customers.

Overview
Communication between two software programs can be done using sockets among others. A socket is identified by an IP address concatenated with a port number. The server waits for incoming clients requests by listening to a specified port. Once the request is received, the server accepts a connection from the client to complete the connection. Servers which implement specific services such as ftp, telnet, http listen on some dedicated ports (telnet (23), ftp (21), http (80), therefore use port numbers bigger than 1024 for that purpose. Ex. Use 54321 - probably nobody is using that.

Instructions
1) Both the server and the client program should be written in C/C++ under Linux.
2) The client program(s) should connect via socket to the running server program.
3) If the server is not available (not running) the client should timeout (try several attempts at some given interval) and exit.
4) The connection IP address (see server's location), the port number, and the maximum number of burgers (in this particular order!) what that particular client can eat will be provided as command line parameters for the client application.
5) Once a client is served with a burger, the application should select randomly between 1, 3 or 5 seconds necessary to consume that particular burger. During that period of time the client can not ask for a new burger. The client should be served till he/she is reaching the maximum number of burgers he/she can eat (see instruction 4) or there are no more burgers left.
6) The maximum number of burgers what the burger joint can produce and the number of chefs available in the burger joint (in that particular order) should be provided as command line arguments when we start the server application.
7) The chefs producing the burgers should run in separate threads. Producing each burger could take randomly 2 or 4 seconds. During that period of time the chef can not produce a new burger. The chef(s) will stop working if the maximum number of burgers provided as command line argument is reached.
8) For each client the server should listen in a separate thread as the clients should be served in parallel.

Reference no: EM133345269

Questions Cloud

Define long and short term goals with citations : Define long and short term goals with citations from your academic research. Identify and justify one long and one short-term goal for the future of WCPS
Environmental and financial sustainability of supply chain : Discuss the impact that freight movement has on the environmental and financial sustainability of a supply chain.
Operations management and project management : How does a firm integrate principles of both operations management and project management to create customer value? Find and cite examples.
Describe agency cots how is it used for competition : Describe Agency cots? How is it used for competition/competitive advantage and making strategic decisions? How does it impact the corporation implementing it?
Write a simulation for a burger joint and its customers : CS 470 Operating Systems, Central Washington University - Write a simulation for a burger joint and its customers. The burger joint should be implemented
Conducts a marking mix gap analysis for coca-cola : Conducts a Marking Mix Gap analysis for Coca-Cola. Use a Marketing Mix Gap Analysis to explain the difference between the total market potential and Coca-Colas
Analyze the information and assist atikah to make a decision : Analyze the information and assist Atikah's to make a decision. Atikah's Donuts budgets the following costs for the production of 40.000 boxes of donuts
What changes in public policy or existing laws : In what areas were emergency management and emergency response personnel successful? Why? In what areas were emergency management and emergency response
Can you help me provide information about the technology : Can you help me provide information about the Technology at Enterprise Level which can discuss the following that I can use for my powerpoint presentation?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd