Got a tricky question? Receive an answer from students like you! Try us!

Programming Project in Java - Assignment Example

Only on StudentShare
Author : lenore42
Pages 8 (2008 words)


1. BurritoBrothers - Shop can be shared by multiple customers at a time, with a limit on total number of customers. Counter Semaphore can be used to keep check on number of customers getting entry into Burrito Brothers shop. Per problem counter semaphore should be initialized to 15.

Extract of sample
Programming Project in Java

Since, there exist a single cash register and only one customer can access it at given moment. A binary semaphore can be used to control customers waiting to pay from paying together, but would ensure they pay one by one.
Since, customer with smallest order needs to get change to aquireCounter first Waiting Area is implemented as TreeSet which automatically sorts objects, if object implements Comparable interface. Customers just need to check whether they are first in Tree Set to know whether they are eligible to acuire Counter Location, if available.
World.log("Admitted one customer " +customer.getCustomerName() + ", additional space for " + customerSemaphore.availablePermits() + " customers available. Waiting area consits of " + customersWaitingForBurrito.toString());
World.log(serverName + " made " + burritosToMake + " burritos for " + customerToServe.getCustomerName() + ", customer still requires " + (customerToServe.getOrderBurritoCount() - customerToServe.getAcceptedBurritos()) + " burritos.");
Download paper

Related Essays

Java programming and written exercises
2. Assume a class Square that implements the interface Comparable. You are required to implement the method compareTo so that squares are compared according to their sides. Part of the Java code has been provided as below. Please complete the code inside the compareTo() method. 4. Write a Java code segment that uses the LinkedList myList and the String array strArr. Store the elements from the array in the linked list. Use an iterator to scan the list and output the elements of strings, whose length is greater than 5.
3 pages (753 words)
The first challenge of project management is ensuring that a project is delivered within the defined constraints. The second challenge is the optimized allocation and integration of the inputs needed to meet those pre-defined objectives. (The Gale Group 2002)…
6 pages (1506 words)
Java Game Programming, any future
The main feature of Java is that it is a platform independent language. The program can be written only once in Java and can be compiled in any operating system. To be simple it is write once, run anywhere. It is an object oriented, multithreaded programming language. (King 2000 ).…
15 pages (3765 words)
critical diference between java and C#
loper the earlier sentence could be explained as ‘a short description of the Java language and platform’ instead the words C# and the .NET platform were replaced with words Java and the Java platform ( Obasanjo, 2007).…
10 pages (2510 words)
Java Graphical user interface (GUI)
In the early 1930s, Vannevar Bush first envisioned of a device he called a “memex,” which was visualized like a “desk with two touch screen graphical displays, a keyboard, and a scanner attached to it” (Reimer). During that time, there was no way to execute his ideas and his concepts caught little attention. It was not until after the Second World War that those computing machines that are programmable were produced. Bush revived his memex desk concept and, in 1945, he published it in his article in Atlantic Monthly, entitled “As We May Think” (Reimer). This was the inspiration of…
3 pages (753 words)
Java Questions
s where the devices are connected via internet while socket programming connects computers to sockets that enable information sharing (Sharma and Deswal, 2014). It was the idea that I used to seal a client for my parents within no time. Negotiation was smooth as it was direct to the individual concerned and enabled immediate feedback. Indeed, business entities should adopt the system as it will save them a lot majorly in costs that might be incurred due to physical movements.…
3 pages (753 words)